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