The title says labels because that's my use case, but obviously it could be any element. What I'm trying to achieve is the following form layout:
[label] [input]
[another label] [input]
[third label] [input]
Currently my HTML roughly looks like (leaving out the details):
div {
overflow: auto;
}
label, input {
float: left;
}
label {
text-align: right;
width: 200px;
}
<div>
<label>Label</label>
<input type="text">
</div>
<div>
<label>Another label</label>
<input type="text">
</div>
<div>
<label>Third label</label>
<input type="text">
</div>
What I'm looking for is the best method to implement this layout while keeping the HTML as semantic as realistically possible (an extra div here or there isn't a problem, I use them now for a lot easier control over the vertical alignment and also some minor styling). Currently my text inputs happen to be the same size, but there's also some groups of radios/checkboxes that would have to reside in the [input]
section.
Also, I'd like to keep my options open for the use of media queries to apply some RWD elements. This isn't a big requirement for this specific project, but you never know. Oh, and I have to support IE as low as 9, unfortunately.
How would I address these issues in a semantically correct (i.e. not using tables) way that is supported by IE9 and IE10?