Label text is wrapped but not indent second line

后端 未结 4 1884
时光取名叫无心
时光取名叫无心 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:39

    text-indent just effected in first line,if you want indent all line, you should use padding and playing around with checkbox input: float:

         .form {
        width: 300px;
      }
    #input2{
        float:left;
    
    }
    #input2 + label
    {
      padding-left: 30px;
    display: block;
    }
    

    here a jsfiddle

提交回复
热议问题