10

假设我有一些单选按钮,其标签如下所示:

<label for="my_radio_button_id">My Label</label>
<input type="radio" name="radio" id="my_radio_button_id" />

如何将每个单选按钮置于其相应标签下方并水平对齐?

4

3 回答 3

27

小提琴

.checkboxgroup {
  display: inline-block;
  text-align: center;
}
.checkboxgroup label {
  display: block;
}
<div id="checkboxes">
  <div class="checkboxgroup">
    <label for="my_radio_button_id1">My Label1</label>
    <input type="radio" name="radio" id="my_radio_button_id1" />
  </div>
  <div class="checkboxgroup">
    <label for="my_radio_button_id2">My Label2</label>
    <input type="radio" name="radio" id="my_radio_button_id2" />
  </div>
  <div class="checkboxgroup">
    <label for="my_radio_button_id3">My Label3</label>
    <input type="radio" name="radio" id="my_radio_button_id3" />
  </div>
</div>

于 2012-06-06T04:59:25.510 回答
2

这行得通吗?http://jsfiddle.net/fFEwh/2/

于 2012-06-06T04:50:24.793 回答
1
于 2012-09-25T17:40:59.167 回答