Possible Duplicate:
How to align checkboxes and their labels consistently cross-browsers




我有以下代码:

<div id="form-footer">
    <ul>
       <li>
           <label for="test">Label text</label>
           <input type="checkbox" name="" value="" id="test" />
       </li>
    </ul>
</div>


如何对齐标签和复选框?目前,我看到复选框相对于标签在顶部对齐,我希望在中间看到它。

最佳答案

如果一切都是单行,则可以使用line-height属性:

#form-footer li { height: 30px; line-height: 30px; /** same as height */ }

关于css - 如何对齐复选框和标签标签? ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9380411/

10-12 07:37
查看更多