Checkboxes and Vertical Text Alignment

You set the vertical-align on the checkbox, not the parent div or the text. Intuitive. Works in Firefox and IE.

<style>
    * {
        font-size: 10px;
    }
    #cb {
        vertical-align: text-bottom;
        _vertical-align: middle;
        padding: 0 !important;
        margin: 0 !important;
    }
</style>
<div>
    <input id="cb" type="checkbox"/> Checkbox
</div>

About this entry


Good Reads