2015-05-05 21 views
1
對準

我面臨的問題是像下面的圖片:enter image description here 很是怪異該標籤和radiobox是不是「同一行」,我的代碼是:引導如何radiobox與標籤

<div class="form-group"> 
<label class="col-sm-3 control-label"><small><span class="text-danger glyphicon glyphicon-asterisk" aria-hidden="true"></span></small>飲食</label> 
<div class="col-sm-8"> 
<div class="input-group"> 
<label><input type="radio" name="food" value="1" id="food" checked> 葷 </label> 
<label><input type="radio" name="food" value="2" id="food"> 素 </label> 
<label><input type="radio" name="food" value="3" id="food"> 不需要</label> 
</div> 
</div> 
</div> 
+0

http://stackoverflow.com/questions/13509883/how-to-vertically-align-a-html-radio-button-to-its-label – trainoasis

+0

使用CSS **垂直對齊**聲明:) – jbutler483

+0

有代碼示例? –

回答

1

嘗試將'radio inline'類添加到控件標籤,它應該與其他標籤正確對齊。

試試這個:

<label class="radio inline control-label">Some label</label> 
+0

嗯......它似乎不工作 –

+0

嗯。只需使用class並在CSS中調用它,然後使用vertical-align:text。 – Elle