I want to have a list of check boxes down the page, which has a label, as shown in the following layout:
My options [x] Checkbox 1
[ ] Checkbox 2
[ ] Checkbox 3
[ ] Checkbox 4
I'm using the method outlined here What is the best way to style a list of checkboxes in the answer by @Magnar. This works fine, but when I wrap the checkbox text as labels, the checkboxes list horizontally across the page in IE (Chrome and Firefox still render it fine).
My HTML:
<div id="options">
<label>My options</label>
<ul>
<li><label><input type="checkbox">Checkbox 1</label></li>
<li><label><input type="checkbox">Checkbox 2</label></li>
<li><label><input type="checkbox">Checkbox 3</label></li>
<li><label><input type="checkbox">Checkbox 4</label></li>
</ul>
</div>
My CSS:
#options label {
float: left;
}
#options ul {
margin: 0;
list-style: none;
float: left;
}
If someone could help me get it to work nicely in IE too I'd really appreciate it. I'd also love to know why it works everywhere but IE :).