Indenting multiline labels

后端 未结 3 1265
孤街浪徒
孤街浪徒 2021-02-07 05:21

I have the following automatically-generated HTML:

http://jsfiddle.net/BrV8X/

What is the advised way, using CSS, to indent the label so that there\'s some white

3条回答
  •  无人共我
    2021-02-07 05:58

    label {
        display: block;
        margin-left: 20px;
    }
    input {
        float: left;
        margin-left: -20px;
        margin-right: 7px;
    }
    

    Here's the fiddle: http://jsfiddle.net/hrfmt/ . Play with the values.

    EDIT:

    If all the browsers you need to support can understand display: inline-block, use that instead of float.

提交回复
热议问题