CSS3快速上手之16:column

22 篇文章 0 订阅

1.代码:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>网页title</title> 
<style> 
.newspaper1
{
	/*---将 div 元素中的文本分为 3 个column---*/
	-moz-column-count:3; /* Firefox */
	-webkit-column-count:3; /* Safari and Chrome */
	column-count:3;
	
	/*---column与column间的间隙为 40 像素---*/
	-webkit-column-gap: 40px; /* Chrome, Safari, Opera */
    -moz-column-gap: 40px; /* Firefox */
    column-gap: 40px;

	/*---指定了column与column间的边框样式---*/	
	-webkit-column-rule-style: solid; /* Chrome, Safari, Opera */
    -moz-column-rule-style: solid; /* Firefox */
    column-rule-style: solid;

	/*---指定column的边框厚度---*/		
	-webkit-column-rule-width: 5px; /* Chrome, Safari, Opera */
    -moz-column-rule-width: 5px; /* Firefox */
    column-rule-width: 5px;

	/*---指定column的边框颜色---*/	
    -webkit-column-rule-color: lightblue; /* Chrome, Safari, Opera */
    -moz-column-rule-color: lightblue; /* Firefox */
    column-rule-color: lightblue;
	
}


/*---指定 h1 元素跨越所有column---*/
h1
{
	column-span:all;
	-webkit-column-span:all; /* Safari and Chrome */
}

/*---指定每个column的宽度---*/
.newspaper2
{	
	-webkit-column-width:100px; /* Safari and Chrome */
	-moz-column-width:100px; /* Firefox */
	column-width:100px;
}

</style>
</head>
<body>

<h1>范例1:固定拆分的column数量与相关格式与颜色参数</h1>
<div class="newspaper1">
CSS frameworks are pre-prepared software frameworks that are meant to allow for easier, more standards-compliant web design using the Cascading Style Sheets language. Most of these frameworks contain at least a grid. More functional frameworks also come with more features and additional JavaScript based functions, but are mostly design oriented and unobtrusive. This differentiates these from functional and full JavaScript frameworks.
</div><br>

<h1>范例2:指定每个column的宽度并进行拆分</h1>
<div class="newspaper2">
CSS frameworks are pre-prepared software frameworks that are meant to allow for easier, more standards-compliant web design using the Cascading Style Sheets language. Most of these frameworks contain at least a grid. More functional frameworks also come with more features and additional JavaScript based functions, but are mostly design oriented and unobtrusive. This differentiates these from functional and full JavaScript frameworks.
</div>


</body>
</html>

2.结果:


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值