CSS3支持多欄,將文本按新聞紙結構排列。
一些最常用的多列屬性如下所示;
Sr.No. | Value & Description |
---|---|
1 | 列計數 用於計算該元素應劃分的列數。 |
2 | 列填充 用於決定如何填充列。 |
3 | 柱間隙 用於確定列之間的間距。 |
4 | Column-Rule 用於指定規則數。 |
5 | 規則顏色 用於指定列規則顏色。 |
6 | 規則樣式 用於指定列的樣式規則。 |
7 | rule-width 用於指定寬度。 |
8 | Column-Span 用於指定列之間的跨距。 |
Example
下面的例子顯示了文本作爲新的紙張結構的排列。
<html> <head> <style> .multi { /* Column count property */ -webkit-column-count: 4; -moz-column-count: 4; column-count: 4; /* Column gap property */ -webkit-column-gap: 40px; -moz-column-gap: 40px; column-gap: 40px; /* Column style property */ -webkit-column-rule-style: solid; -moz-column-rule-style: solid; column-rule-style: solid; } </style> </head> <body> <div class = "multi"> Tutorials Point originated from the idea that there exists a class of readers who respond better to online content and prefer to learn new skills at their own pace from the comforts of their drawing rooms. The journey commenced with a single tutorial on HTML in 2006 and elated by the response it generated, we worked our way to adding fresh tutorials to our repository which now proudly flaunts a wealth of tutorials and allied articles on topics ranging from programming languages to web designing to academics and much more. </div> </body> </html>
它將產生以下結果&負;
假設,如果用戶希望將文本製作爲不帶行的新紙張,我們可以通過刪除如下所示的樣式語法來完成此操作;
.multi { /* Column count property */ -webkit-column-count: 4; -moz-column-count: 4; column-count: 4; /* Column gap property */ -webkit-column-gap: 40px; -moz-column-gap: 40px; column-gap: 40px; }
它將產生以下結果&負;