Home > Web Front-end > CSS Tutorial > CSS3 Tutorial-Multiple Columns

CSS3 Tutorial-Multiple Columns

黄舟
Release: 2016-12-27 15:36:16
Original
1626 people have browsed it

Hello! Friends, have you digested the CSS3 tutorial-animation knowledge in our last article? The new multi-column layout in CSS3 is a powerful expansion of the block layout mode in traditional HTML web pages. This new syntax allows WEB front-end developers to easily display text in multiple columns.

CSS3 Multiple Columns:

With CSS3 you can create multiple columns to lay out your text – just like a newspaper!

In this chapter, you will learn the following multi-column attributes:

1. column-count;

2. column-gap;

3. column-rule.

Browser support:

CSS3 Tutorial-Multiple Columns

Internet Explorer 10 and Opera support multi-column properties.

Firefox requires the prefix -moz-.

Chrome and Safari require the prefix -webkit-.

Note: Internet Explorer 9 and earlier versions do not support multi-column properties.

CSS3 Create multiple columns:

The column-count attribute specifies the number of columns by which the element should be separated:

Example:

Put the text in the div element Separated into three columns:

div
{
-moz-column-count:3; /* Firefox */
-webkit-column-count:3; /* Safari 和 Chrome */
column-count:3;
}
Copy after login

CSS3 specifies the gap between columns:

column-gap attribute specifies the gap between columns:

Example:

Specify the 40 pixel spacing between columns:

div
{
-moz-column-gap:40px; /* Firefox */
-webkit-column-gap:40px; /* Safari 和 Chrome */
column-gap:40px;
}
Copy after login

CSS3 column rules:

column-rule property sets the width, style and color rules between columns.

Example:

Specify width, style and color rules between columns:

div
{
-moz-column-rule:3px outset #ff0000; /* Firefox */
-webkit-column-rule:3px outset #ff0000; /* Safari and Chrome */
column-rule:3px outset #ff0000;
}
Copy after login

New multi-column properties:

Listed in the table below All conversion attributes:

CSS3 Tutorial-Multiple Columns

The above is the content of CSS3 tutorial-multi-column. For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template