How to align checkboxes and their labels consistently cross-browsers

前端 未结 30 1857
有刺的猬
有刺的猬 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条回答
  •  不思量自难忘°
    2020-11-22 06:07

    If you use ASP.NET Web Forms you don't need to worry about DIVs and other elements or fixed sizes. We can align the text by setting float:left to the CheckboxList input type in CSS.

    Please check the following example code:

    .CheckboxList
    {
        font-size: 14px;
        color: #333333;
    }
    .CheckboxList input
    {
        float: left;
        clear: both;
    }
    

    .ASPX code:

    
    
    

提交回复
热议问题