Checkbox and radio buttons in JQuery UI are stacked vertically on top of each other, rather than adjacent to each other

Here is the HTML code snippet:

<div id="container">
  <div id="signals-summary-parameters-radio">
    <fieldset>
      <legend>Row Filter : </legend>
      <label for="signals-summary-radio-all">All</label>
      <input type="radio" name="radio" id="signals-summary-radio-all">
      <label for="signals-summary-radio-active">Active</label>
      <input type="radio" name="radio" id="signals-summary-radio-active">
      <label for="signals-summary-radio-new">New</label>
      <input type="radio" name="radio" id="signals-summary-radio-new">
    </fieldset>
  </div>
</div>
<div id="container-2">
  <div id="signals-summary-parameters-radio-2">
    <fieldset>
      <legend>Row Filter : </legend>
      <label for="signals-summary-radio-all-2">All</label>
      <input type="radio" name="radio" id="signals-summary-radio-all-2">
      <label for="signals-summary-radio-active-2">Active</label>
      <input type="radio" name="radio" id="signals-summary-radio-active-2">
      <label for="signals-summary-radio-new-2">New</label>
      <input type="radio" name="radio" id="signals-summary-radio-new-2">
    </fieldset>
  </div>
</div>

The JavaScript code:

$(function() {
  $("#signals-summary-parameters-radio input").checkboxradio();
  $("#signals-summary-parameters-radio-2 input").checkboxradio();
});

And lastly, the CSS code:

#container {
  display: grid;
  grid-template-rows: minmax(30px);
  grid-template-columns: repeat(10, 1fr);
}

I have created a JSFiddle with all the code here.

In my real-world webpage, using the CSS display:grid causes the radio buttons to stack on top of each other rather than side by side. How can I adjust my CSS to make the radio buttons align horizontally like in the container-2 div?

Answer №1

Make sure to define the width of the "div" element within the specified container. Check out this example on https://jsfiddle.net/3ea0k4r6/1/

#container div {
  width:220px;
}

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

Acquire the values of keys within a JSON array

As I work on iterating through a JSON array, I am aiming to extract the key values of each record within it. At present, my JSON object presents itself in the following structure: "users": { "key_11": { "text": "11" }, "key_22": { ...

JQuery submit button fails to trigger

I've been troubleshooting the following code but I'm not getting any errors or results when I click on the save button. Can someone please help me identify the issue? Thank you. <script type="text/javascript"> $(document).ready(function () ...

When trying to make a jQuery call using ajax, there is no response being received

I'm facing a slight issue with a gift list that is generated from SQL. My objective is to display each row as a form with a textbox and a button. When the button is clicked, I want to send the textbox value and an ID number (hidden field value) to a f ...

Will PhoneGap applications reset after being updated?

I'm currently working on an iOS PhoneGap app with plans for future updates. One concern I have is that sometimes these updates are not backwards-compatible, and I worry that the app may still be using an outdated cache or session despite the update. ...

Guide: Exchanging choices using jQuery and Address plugin

I am trying to find a way to exchange the values of two options with each other. I created a simple fiddle that successfully swaps input values, but when I tried it with select options, it didn't work as expected. The approach I'm using is based ...

Setting a CSS Variable with the Help of jQuery

I need help with changing the background color of a specific .div element when it is clicked on. I want the color to be a variable that can be changed by the user, and this change should occur when the document is ready. Currently, I am using a CSS variab ...

The application of document.body.style.backgroundColor is not compatible with an external CSS style sheet

Why does document.body.style.backgroundColor not work with an external CSS style sheet? I have the following CSS: body { background-color: red; } In my css style sheet, when I use JavaScript alert alert(document.body.style.backgroundColor);, it sh ...

The footer is being obscured by the sidebar

#contents { width: 1100px; margin-left: auto; margin-right: auto; } #sidebar { padding: 10px; position: sticky; top: 20px; left: 10px; width: 150px; border-right: 1px solid black; float: left; } #main { padding: 15px; margin-left: ...

Preventing automatic recompilation in Angular when there are changes in the assets folder

I am facing an issue while attempting to download a file generated from a Spring Boot application in the assets folder of an Angular project. Every time I call the Spring API from Angular services, the Angular CLI recompiles the project after creating the ...

What is the use of eRB with various syntax for multiple statements?

I am working with an html.erb file and using link_to to create a hyperlink while the t() function is used for internationalization. However, the code appears quite clunky: <p><%= t('session.new_user') %><%= link_to(t('session ...

Choosing a Webpage Navigation Tab with Excel VBA

Having trouble selecting one of the navigation tabs on a webpage, even after coding for ID, password, and other screens. I've tried various combinations of "GetElementBy" without success. The tabs don't seem to be in their own frame. Here is the ...

Capture data from clipboard as it is being pasted into Handsontable

Issue Description and Troubleshooting: In a nutshell, I am seeking a method to manage data copied from the clipboard to a handsontable. I came across a suggestion on how to fetch this information using jQuery in a stackoverflow post: $("#haras_excel_li ...

JavaScript may not display height as anticipated

Currently, I am experimenting with JavaScript in order to achieve a website section that is 100% the height of the screen minus the "nav" bar. Imagine it as having two visible components - the first one being large and the second one small at the bottom. ...

Utilizing jQuery in your webpack configuration for optimal performance

I encountered some issues while trying to test a simple project that involves using a jQuery function with webpack. The errors occurred during the bundling process and are as follows: ERROR in ./~/jQuery/lib/node-jquery.js Module not found: Error: Cannot ...

A unique and dynamic design concept for my website: a zigzagging structure

I am trying to achieve a layout similar to the one at the provided link, with variable sized div tags on the left and right edges. Can someone please assist me in styling the left and right sides accordingly? Key styles I have used: .rightside { margin-l ...

Div overlaps div on certain screen dimensions

When the screen size falls within a specific range, typically in the low 1000s, there is an issue where my content div overlaps completely with the navigation div. It appears as if both divs are positioned at the top of the page. Below is the HTML code sn ...

The transparency effect on the overlaying image gradually diminishes as the images transition in the jQuery slideshow on Internet

My slideshow smoothly transitions between images, with a logo positioned to partly overlay it. Everything looks great except for one pesky issue in IE6 - when the images change, the part of the logo that overlaps the slideshow also fades. I don't wan ...

Upon loading, the Carousel is visible instead of being hidden, which is contrary to its intended behavior

Any help would be greatly appreciated as I am struggling with creating a web page featuring tabs for "London, New York, Shanghai". The initial page displayed is the "welcome" page with the other tabs hidden on load. I successfully implemented a carousel f ...

Retrieve the element that comes before

Currently seeking the previous .item Here is the setup: <div id="um" class="item">um</div> <div id="dois" class="item">dois</div> <div id="tres" class="item active">tres</div> <div id="quatro" class="item">quatro ...

Press the toggle button to switch the image display

Currently learning HTML and attempting to design a dashboard. I want to display the status (ON, OFF, OPEN, or CLOSED) of a room or door using an icon. I have images for open/close doors and lightbulbs. Need assistance in adding an element to all the exist ...