bootstrap 3 input-group 100% width

后端 未结 5 2091
无人及你
无人及你 2021-02-12 23:59

In the bootstrap documentation, they have input groups that span 100% width with no additional markup: http://getbootstrap.com/components/#input-groups

5条回答
  •  醉酒成梦
    2021-02-13 01:05

    input-group has display: table css property, while the has display: table-cell css property.

    .00

    According to HERE, under "Important Style Rules for Tables",

    Width works on table cells just about how you would think it does, except when there is 
    some kind of conflict. For instance if you tell the table itself to be 400px wide then the 
    first cell of a three-cell row to be 100px wide and leave the others alone, that first cell
    will be 100px wide and the other two will split up the remaining space. 

    it explains that if the width of the child element that has table-cell is defined (let's say width: 100px), then the next child element with table-cell property, although not defined, will fill in the rest of the space.

提交回复
热议问题