How to align checkbox and label tag?

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

I have this code:

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

How can I align the label and the checkbox? At the moment I see the checkbox align on top with respect to the label, I would like to see it in the middle.


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

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

​input[type=checkbox] { vertical-align: middle; }​

或者任何vertical-align属性

链接地址: http://www.djcxy.com/p/41446.html

上一篇: 将INPUT字段泛化

下一篇: 如何对齐复选框和标签标签?