Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6134153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:19:11+00:00 2026-05-23T17:19:11+00:00

I have an HTML form with sections laid out like this: I do want

  • 0

I have an HTML form with sections laid out like this:
enter image description here

I do want the labels to be inline so that this section won’t be 7 line breaks tall, but I would like to know how I can make sure the radio buttons stay with their labels.

Note: the labels are of varying lengths and are populated dynamically with data from the server, so I can’t set a fixed width div without causing some weird spacing issues.

If there is an idiomatic way of doing this, please show me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:19:12+00:00Added an answer on May 23, 2026 at 5:19 pm

    Put each input/label pair in a span, then set white-space: nowrap on the span. Something like this:

    <div class="radios">
        <span>
            <input type="radio" id="productTypeRC" />
            <label for="productTypeRC">RC</label>
        </span>
        ...
    </div>
    

    CSS:

    .radios > span
    {
        white-space: nowrap;
    }
    

    Edit: The above technique suffers from a bug in Chrome where the pairs don’t wrap and instead are hidden. This bug is demonstrated in the question Text doesn’t wrap properly between elements having white-space: nowrap. Solutions include using float: left with some margin added to make up for collapsed spacing, or to muck with the HTML until it works. If you just put the <input> and <label> as the same line as the <span>, it works.

    <div class="radios">
        <span><input type="radio" id="productTypeRC" /> <label for="productTypeRC">RC</label></span>
        <span><input type="radio" id="productTypeTC" /> <label for="productTypeTC">TC</label></span>
        <span><input type="radio" id="productTypeNS" /> <label for="productTypeNS">NS</label></span>
        ...
    </div>
    

    jsfiddle.net/Z5uaT/57

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For instance, I want to have a html form that looks like this: <table>
I have html output in paging section like this; <p>&nbsp;<strong class=active>1</strong>&nbsp;<a href=http://localhost/project/report_nc/search_now/1>2</a>&nbsp;<a href=http://localhost/project/report_nc/search_now/2>3</a>&nbsp;<a href=http://localhost/project/report_nc/search_now/1>Next
I have html like this: <div> <span style=display: inline-block;height:20px>20</span> <span style=display: inline-block;><img src=img/ex.png/></span> </div>
I have an html form with a section that generates inputs with random names.
I have a HTML form, and I have a Controller Action that accepts the
I have a html form with the data by this post method 'form id='form1'
I have an html page with divs that have id (s) of the form
I have two sections in a form, and I have a button that toggles
I have a complex form that has a static section and one that can
I have a form that generates sortable divs. I am using .append() and .html()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.