CSS3 Multi-Column layout

Source: Internet
Author: User

Properties and versions
CSS3 provides a collection of 7 properties, such as columns multi-column layout properties, as follows:

Because the column attribute set is not yet included in the standard, most browsers have to use the vendor prefix to access it, and the mainstream browser is well-supported. The following are the support and prefix scenarios for mainstream browsers.

From the table above, we can see that in order for the latest browser to achieve the full effect, you must use the former
Embellished
Finished XXX type
-webkit-columns:150px 4;
-moz-columns:150px 4; Columns:border-box;

Attribute interpretation
For the convenience of demo, we tested in Firefox Firefox and only demonstrated with the-moz-prefix.
1.columns
Columns is a composite property that contains both shorthand for columns-width and Columns-count. Sets the number of columns and the column width at the same time.
Divided into four columns, each row width adaptive
-moz-columns:auto 4;

2.column-width
The Column-width property is used to set the width of each column.
Set column widths

-moz-column-width:200px;
Here set the 200px, a little bit the meaning of the minimum width. When the browser zooms to a size less than 200, it becomes 1
Column display. And if it is auto, it keeps four columns.

3.column-count
The Column-count property that is used to set how many columns.
Set Number of columns
-moz-column-count:4;

4.column-gap
Column-gap property, for setting column spacing
Set column spacing
-moz-column-gap:100px;

5.column-rule
Column-rule property, sets the split line in the middle of each column
Set column edges
-moz-column-rule:2px dashed gray;

The column edges do not affect the layout, and it adjusts to show whether the layout is scaled itself. If we zoom the page to show only one column, it disappears automatically.

6.column-span
Column-span property, set the cross-column headline.
Cross-column header, fixed using WebKit because Firefox is not supported
-webkit-column-span:all;

CSS3 Multi-Column layout

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.