CSS3 Column Implementation example of multi-column layout

Source: Internet
Author: User

The following code describes the authoring specification using 3 columns, which includes the browser prefix

The code is as follows Copy Code


#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;

Complete example

The code is as follows Copy Code

<! DOCTYPE html>
<meta charset= "UTF-8" >
<meta charset= "Utf-8" >
&LT;TITLE&GT;CSS Columns Sample page-Q </title>
<style>
body{font:14px/1.5 Georgia,serif,sans-serif;}
p{margin:0;padding:5px 10px;background: #eee;}
h1{margin:10px 0;font-size:16px;}
. test{
width:628px;
border:10px solid #000;
-moz-columns:200px 3;
-webkit-columns:200px 3;
columns:200px 3;
}
. test2{
border:10px solid #000;
-moz-columns:200px;
-webkit-columns:200px;
columns:200px;
}
</style>
<body>
<div class= "Test" >
<p>this module describes multi-column layout in CSS. By using
Functionality described in this document, style sheets can declare that
The content of an has the element is laid out in multiple columns. </p>
<p>on the Web, tables have also been used to describe multi-column
Layouts. The main benefit of the 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 is presented on
Various output devices including speech synthesizers and small mobile
Devices.</p>
</div>
<div class= "Test2" >
<p>this module describes multi-column layout in CSS. By using
Functionality described in this document, style sheets can declare that
The content of an has the element is laid out in multiple columns. </p>
<p>on the Web, tables have also been used to describe multi-column
Layouts. The main benefit of the 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 is presented on
Various output devices including speech synthesizers and small mobile
Devices.</p>
</div>
</body>

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.