How to align checkboxes and their labels consistently cross-browsers

前端 未结 30 1784
有刺的猬
有刺的猬 2020-11-22 05:56

This is one of the minor CSS problems that plagues me constantly. How do folks around Stack Overflow vertically align checkboxes and

30条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 06:26

    CSS:

    .threeCol .listItem {
        width:13.9em;
        padding:.2em;
        margin:.2em;
        float:left;
        border-bottom:solid #f3f3f3 1px;
    }
    .threeCol input {
        float:left;
        width:auto;
        margin:.2em .2em .2em 0;
        border:none;
        background:none;
    }
    .threeCol label {
        float:left;
        margin:.1em 0 .1em 0;
    }
    

    HTML:

    The above code will place your list items in threecols and just change widths to suit.

提交回复
热议问题