CSS3学习之等高列

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>CSS3创造3列</title>
<style type="text/css">
*{  
    margin:0;  
    padding:0;  
}
body {
	font: 12px "宋体";
	margin: 20px;
}
h1 {
	font-size: 24px;
	font-weight: normal;
}
.col {
	-moz-column-count:3;
	-moz-column-width:140px;
	-moz-column-gap:20px;
	-moz-column-rule:1px solid #333;
	-webkit-column-count:3;
	-webkit-column-width:140px;
	-webkit-column-gap:20px;
	-webkit-column-rule:1px solid #333;
	column-count:3;
	column-width:140px;
	column-gap:20px;
	column-rule:1px solid #333;
	background:#FEF4D1;
}
</style>
</head>

<body>
<h1>Who is Andy</h1>
<div class="col">		
	<p>Andy is the Managing Director of Clearleft. He also goes by the title of User Experience Director depending what mood he’s in. Andy is the author of CSS Mastery, curates the dConstruct and UX London events and is responsible for Silverbackapp, our low cost usability testing application for the Mac. Richard is a founding partner and the production director for Clearleft. He has been designing websites and web applications since the birth of the commercial web, over twelve years ago. Richard leads the user experience team at Clearleft, pioneering innovative approaches to designing fantastic experiences for clients and their customers. Jeremy is a hugely experienced developer specialising in XHTML, CSS, Javascript and PHP-driven solutions. Jeremy is technical director at Clearleft.</p>
</div>
</body>
</html>


column-count分列的列数 

column-width每列的列宽

column-gap设置列之间的间隔宽度

column-rule设置列间隔线的设置

 

实际操作发现,IE8 完全不支持 opera分成了9列,只能算他不支持

firefox chrome safari均很好的支持,另外发现,如果容器的宽度不够,也就是把浏览器的大小调整,当容器不够容纳3列的列宽之和,那么就变成2列,如果再小就变成1列

 

 

 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值