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

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.
Put each input/label pair in a span, then set
white-space: nowrapon the span. Something like this:CSS:
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 usingfloat: leftwith 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.jsfiddle.net/Z5uaT/57