解决等高列的方法

https://css-tricks.com/fluid-width-equal-height-columns/

常用方法
1. css3属性 -webkit-linear-gradient
2. 伪类before after
3. table
4. display:table; table-cell
5. one true layout method

<div id="one-true" class="group">
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
</div>

css:

#one-true{ overflow: hidden; } 
#one-true .col { width: 27%; padding: 30px 3.15% 0; float: left; margin-bottom: -99999px; padding-bottom: 99999px; } 
#one-true .col:nth-child(1) { margin-left: 33.3%; background: #ccc; } 
#one-true .col:nth-child(2) { margin-left: -66.3%; background: #eee; } 
#one-true .col:nth-child(3) { left: 0; background: #eee; } 
#one-true p { margin-bottom: 30px; } /* Bottom padding on col is busy */
  1. flexbox method
  2. js method

推荐伪类的方法,兼容性好
参考链接
http://nicolasgallagher.com/multiple-backgrounds-and-borders-with-css2/demo/backgrounds.html
这个里面可以有间距
http://callmenick.com/post/css-equal-height-columns-three-different-ways
这个里面也提了一些解决方案
http://webdesign.tutsplus.com/tutorials/quick-tip-solving-the-equal-height-column-conundrum–cms-20403

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值