一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

CSS3中Column实现多栏布局示例

时间:2022-06-25 13:42:39 编辑:袖梨 来源:一聚教程网

下面这个代码介绍了使用3列的编写规范,其中包括了浏览器前缀

 代码如下 复制代码


#columns-3 {
    text-align: justify;
    -moz-column-count: 3;
    -moz-column-gap: 12px;
    -moz-column-rule: 1px solid #c4c8cc;
    -webkit-column-count: 3;
    -webkit-column-gap: 12px;
    -webkit-column-rule: 1px solid #c4c8cc;

完整例子

 代码如下 复制代码





CSS columns示例页面 - 问说



列数及列宽固定:



 

This module describes multi-column layout in CSS. By using
functionality described in this document, style sheets can declare that
the content of an element is to be laid out in multiple columns.


 

On the Web, tables have also been used to describe multi-column
layouts. The main benefit of using CSS-based columns is flexibility;
content can flow from one column to another, and the number of columns
can vary depending on the size of the viewport. Removing presentation
table markup from documents allows them to more easily be presented on
various output devices including speech synthesizers and small mobile
devices.



列宽固定,根据容器宽度液态分布列数:



 

This module describes multi-column layout in CSS. By using
functionality described in this document, style sheets can declare that
the content of an element is to be laid out in multiple columns.


 

On the Web, tables have also been used to describe multi-column
layouts. The main benefit of using CSS-based columns is flexibility;
content can flow from one column to another, and the number of columns
can vary depending on the size of the viewport. Removing presentation
table markup from documents allows them to more easily be presented on
various output devices including speech synthesizers and small mobile
devices.




热门栏目