Label text is wrapped but not indent second line

后端 未结 4 1873
时光取名叫无心
时光取名叫无心 2020-11-30 15:23

I have a form with limited width, however the label text maybe longer than form width, so the text was wrapped to multiple lines. My problem is that first line is indented b

4条回答
  •  情话喂你
    2020-11-30 15:31

    You could do something like this:

    HTML

    CSS

    .form {
      width: 300px;
    }
    
    .form ul {
      list-style:none;
      padding: 0;
    }
    
    .form ul li {
      overflow:hidden;
    }
    
    .form ul li.checkbox input {
      float:left;
    }
    
    .form ul li.checkbox label {
      float:right; 
      width:270px;
    }
    

    You can also use div's instead of an ul.

提交回复
热议问题