HTML and CSS Reference
In-Depth Information
The following code builds on the previous examples and demonstrates
two possible ways to deal with these exceptions ( Figure 11.7 ):
label ,
span.label {
float: left;
clear: left;
width: 150px;
min-height: 1em; /* keep empty span open */
margin: 0 10px 0 0;
padding: 0;
text-align: right;
}
[...]
p label,
input[type="radio"]+label { /* reverse baseline label style */
float: none;
width: auto;
margin: 0;
}
[...]
<fieldset>
<legend>Questionnaire</legend>
<div class="field">
<span class="label"></span>
<input type="radio" name="chooseOption"
id="chooseOption[1]" value="1">
<label for="chooseOption[1]">Option One</label>
<input type="radio" name="chooseOption"
id="chooseOption[2]" value="2">
<label for="chooseOption[2]">Option Two</label>
Search WWH ::




Custom Search