So I'd like to stack items vertically within a div and stack multiple divs horizontally like the following illustration:
Each div is defined with a class name of floatbox
<div class="floatbox">
<label>Screening Type:</label>
<select></select>
</div>
For which I was applying the following css
<!-- language: lang-css -->.floatbox {
display: inline-block;
width: 175px;
margin: 0;
padding-top: 5px;
float: left;
}
I need float because IE8 will treat it as a block level element unless you use float
. However, when I add it, the items get shifted around. I can correct this by adding two extra <br\>
elements, but I'm wondering if that's the best sollution
See this fiddle for an example