2012-08-30 18 views

回答

5

的封闭形式,标签使用.form-inline通常会解决任何垂直调整我遇到的问题,但它可能不适合所有情况。

更新

引导现在也有几个类,你可以申请到一个封闭块,以排队分别复选框,单选按钮,用下面的文字。从他们的文档:

<label class="checkbox"> 
    <input type="checkbox" value=""> 
    Option one is this and that—be sure to include why it's great 
</label> 

<label class="radio"> 
    <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked> 
    Option one is this and that—be sure to include why it's great 
</label> 
<label class="radio"> 
    <input type="radio" name="optionsRadios" id="optionsRadios2" value="option2"> 
    Option two can be something else and selecting it will deselect option one 
</label> 

它不必是一个标签 - 任何块元素应该工作。

请参阅:http://twitter.github.com/bootstrap/base-css.html#forms(“复选框和收音机”部分)。

1

对我来说,显示内联元素的各种方式并不能解决问题。我意识到这个问题不是显示器,而是单选按钮的内容高度(由于某些原因,46px)。

因此,设置单选按钮为“自动”的高度,解决了我的问题:

input[type='radio'] { 
    height: auto; 
}