bootstrap列高度_html – 不同高度的Bootstrap流体列列

问题

问题是所有引导列试图向左浮动.

when an element is floated it is taken out of the normal flow of the document. It is shifted to the left or right until it touches the edge of its containing box or another floated element.

所以当你有不均匀的高度元素,正确的行为是将它们堆叠在一边.

幸运的是,有很多方法来纠正这个预期的行为:

使用CSS清除属性

The clear CSS property specifies whether an element can be next to floating elements that precede it or must be moved down (cleared) below them

对于这个确切的结构,您可以使用nth-child selector对每个其他行应用清楚:

.col-xs-6:nth-child(odd) {

clear: both;

}

Note: The 07003

演示jsFiddle /堆栈片段:

.col-xs-6:nth-child(odd) {

clear: left;

}

.col-xs-6 {

border: 1px solid grey;

}

Two

Lines

Tw

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值