Input box 100% width, with label to the left

后端 未结 2 1332
无人共我
无人共我 2021-02-06 05:48

I\'m trying to have a fluid input box with 100% width, while having the label floated to the left. Here\'s what I currently have:

.left {
  float: left;
}

inpu         


        
2条回答
  •  隐瞒了意图╮
    2021-02-06 06:29

    See: http://jsfiddle.net/r2769/ (resize the window)

    CSS:

    .left {
        float: left;
    }
    
    .left2 {
        overflow: hidden;
        display: block;
        padding: 0 4px 0 10px
    }
    .left2 input {
        width: 100%
    }
    

    HTML:

    An explanation of the method is here.

提交回复
热议问题