How To Align Radio Buttons Horizontally Below Labels
So I am using the following HTML to display 4 radio buttons horizontally centered underneath their respective labels in a jsp: Copy
<div id="radioGroup">
<div class="wrap">
<label for="markStudent">Mark User as Student</label>
<input type="radio" name="mark" id="markStudent" value="Student" />
</div>
<div class="wrap">
<label for="markAdmin">Mark User as Admin</label>
<input type="radio" name="mark" id="markAdmin" value="Admin" />
</div>
<div class="wrap">
<label for="markService">Mark User as Service</label>
<input type="radio" name="mark" id="markService" value="Service" />
</div>
<div class="wrap">
<label for="markNull">Mark User as Null</label>
<input type="radio" name="mark" id="markNull" value="Null" />
</div>
</div>
Note:
This is incorrect on two fronts:
.radioGroup label input[type="radio"] {
display: block;
margin: 0.5em auto;
}
Firstly, the element has an ID of radioGroup
not class
Secondly, the input is not a child of the label but rather a sibling
Post a Comment for "How To Align Radio Buttons Horizontally Below Labels"