Align the radio button, dropdown menu, and checkbox in a single row

I'm attempting to align a radio button, dropdown, and checkbox on the same line where the second radio button is displayed. I'm utilizing Bootstrap 4, but I'm open to plain HTML that doesn't necessarily follow Bootstrap styling.

I tried using display:inline or display:inline-block with a div surrounding the second radio group, but the checkbox stubbornly remains in the line below rather than inline.

Desired layout:

   Line 1:  Radio button (Popular)
       Line 2:  Radio button (Order), Dropdown, Checkbox
    

Current layout:

   Line 1:  Radio button (Popular)
       Line 2:  Radio button (Order), Dropdown
       Line 3:  Checkbox
    

See code snippet below:

<div class="form-check">
        <label class="form-check-label">
            <input style="height:1em; width:1em;" type="radio" class="form-check-input" value="popular" name="abc" checked>Popular
        </label>
    </div> 
    <div class="form-check">    
        <div style="display:inline-block;">    
            <label class="form-check-label">
                <input style="height:1em; width:1em;" type="radio" class="form-check-input" value="order" name="abc" checked>Order
            </label>
            <select id="user_tag_dropdown">
                <option>One</option>
                <option>Two</option>
            </select>  
            <div class="checkbox">
                <label>
                    <input type="checkbox"> All
                </label>
            </div>
        </div>    
    </div>  
    

Answer №1

Make sure to implement it in the following way:

 <div class="form-check">
    <label class="form-check-label">
      <input style="height:1em; width:1em;" type="radio" class="form-check-input" value="popular" name="abc" checked>Popular
    </label>
</div> 
<div class="form-check">    
    <div style="display:inline-block;">    
        <label class="form-check-label">
            <input style="height:1em; width:1em;" type="radio" class="form-check-input" value="order" name="abc" checked>Order
        </label>
        <select id="user_tag_dropdown">
            <option>One</option>
            <option>Two</option>
        </select>  
        <div class="checkbox" style="display: inline">
            <label>
              <input type="checkbox"> All
            </label>
        </div>
    </div>    
</div>  

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Take away the attention from the span element

I have been experimenting with the following jsfiddle and attempted various methods suggested in this Stack Overflow thread, but I am struggling to remove the focus from the "feedback" span after clicking on the cancel button in jQuery confirm dialog. Her ...

Unable to set SimpleLazyObject as the value for the CustomUser model in Django

Hey everyone, I ran into an issue with my blogpost. Every time I try to add a new one, I encounter this error: ValueError at /pages/blog/new/ Cannot assign "<SimpleLazyObject: <CustomUser: <a href="/cdn-cgi/l/email-protection" class="__cf_email__ ...

Why are the icon pictures not displaying in Angular's mat-icon-button?

Recently, I stumbled upon a snippet of code in an Angular project that caught my eye. Naturally, I decided to incorporate it into my own program: <div style="text-align:center"> <a mat-icon-button class="btn-google-plus" href="http://google.com ...

When a height is specified in percentage, the Tbody element does not display correctly on the entire page

Hey there! Currently, I am working on a fixed header table. My goal is to create a table where the tbody section expands with the screen size and I would like to set the height in percentage (%) but unfortunately it doesn't seem to be functioning as e ...

What method can be used to obtain a parallel vector on a plane that has been struck by an intersecting ray?

Issue at hand: https://i.sstatic.net/H5g5M.jpg Given parameters: intersect, n, p. With p representing a random point in the space, and N as the normal of the plane. Desired result: w Approach attempted in my shader code: "vec3 n = normalize(faceNormal ...

Challenged with selecting an item within select2 due to the presence of a lower-down multiple select

Why am I unable to select options 2 & 3 when I open #s1? Instead, when I click on them, the cursor goes into #s2. How can I resolve this issue? I initially considered that it might be related to the z-index, but after attempting to adjust it, the prob ...

Grid layout with Tailwind

I'm facing a challenge in my Angular project where I need to create a grid layout with 2 rows and 6 columns using Tailwind CSS. The actors array that I am iterating through contains 25 actors. My objective is to show the first 12 actors in 2 rows, fo ...

My sub menu bar is not working properly, I need to fix it so that it can dropdown correctly

I'm struggling with my sub menu layout and need some assistance in fixing it. I've tried numerous times to adjust it using CSS, but without success. Here is the link to my menu. I'm still learning CSS and could really use some guidance: # ...

Troubleshoot: Why is my Google Chrome not playing videos? Uncover the solution with a

I have created a webpage with an HTML video tag that loads dynamically from a JSON file. I am currently using Chrome 50 for this project. The response is successful, and when inspecting the page using Chrome's developer tools, I can see the video tag ...

Creating a circular array of raycast directions with HTML Canvas 2D

I'm currently working on implementing raycasting in typescript with HTML Canvas 2D based on the tutorial from this video: https://youtu.be/TOEi6T2mtHo. However, I've encountered an issue where the rays being cast consistently point in a single di ...

Does the html label prevent propagation from occurring?

Can anyone explain why the toggle function is not being executed when clicking inside the box with the black border, but works when clicking outside of it (although not on the checkbox)? var checks = document.querySelectorAll("ul li"); for (var i = 0 ...

Question about the origin of style sheet source files [*.css?ver=]

Can you explain the purpose of appending a query string to the end of a style sheet? I frequently come across examples like this: some-stylesheet.css?ver=1.2.3 Appreciate your insights. ...

Create a stylish Bootstrap 3 modal featuring an image and convenient scroll bars

My dilemma is with a modal dialog containing an image of fixed width set at 1500px. I want the image to maintain this size and for scroll bars to appear on smaller screen sizes, allowing users to scroll through the entire image. Essentially, I need the mod ...

Adapting pre-designed CSS for Sharepoint 2010

Currently in the process of integrating Bootstrap into my Sharepoint 2010 site and addressing issues as they arise. However, I am struggling to identify the class responsible for the 'hover' and 'active' effects in the Global Navigation ...

Displaying block in front of flex-items

I have been trying to figure out how to get the red box to display in front of the other flex items, but none of my attempts seem to work. .box { font-size: 2.5rem; width: 100px; line-height: 100px; text-align: center; } .front .box { margin: ...

JavaScript xPath is ineffective at providing a return value

Trying to work through an issue with xPath and I am new to this concept. Any guidance or assistance in JavaScript would be greatly appreciated. Here is the simple HTML document that I have: <!DOCTYPE html> <html> <head> < ...

Steps for embedding PHP files into HTML code

Within my htdocs directory, I have a folder named "try" where I connected a PHP file to an HTML file. However, the PHP file is not being included properly. Could there be an issue with my code? <?php include 'init.inc.php'; ?> Both the ...

Guide to inserting a custom image into an Icon in next js

For my Next.js 13 and Tailwind project, I am looking to customize a chat/messenger icon by filling it with an image of my choice. While attempting to use the Lucide React Messenger icon, I found that it only allows hex color values for filling, but I want ...

Is it possible to use a single function to both set the state and return JSX?

I'm currently grappling with creating a function that, when called, will update the state to an object {item: 'whatever the user types', list: [...list, todo]}. The challenge I'm facing is figuring out how to update the state and return ...

When attempting to use the jsonify method on a variable within an html file, the output is not displayed

Is it possible to store "jsonify" in a variable? I find the pure json format of "return jsonify(data)" unappealing, so I am looking for a way to enhance it using an HTML template with proper indentation. Here's the python code I have: from flask impo ...