CSS3 multi-column style layout

Source: Internet
Author: User

Reading the time, met CSS3 a new multi-column layout style properties, test, paste code out:

The current attribute still requires a private prefix with the browser kernel:

Look at the HTML code first:

1 <BODY>2     <Divclass= ' main '>3         <P>My father was a self-taught mandolin player. He is one of the best string instrument players He could not read music, but if he heard a tune a few times, he could play it. When he is younger, he was a member of a small country music band. They would play at local dances and on a few occasions would play for the local radio station. He often told us how he had auditioned and earned a position in a band the featured Patsy Cline as their lead singer. He told the family that after he is hired he never went back. Dad was a very religious man. He stated that there is a lot of drinking and cursing the day of his audition and he does not want to being around that type of environment.</P>4         <P>My father was a self-taught mandolin player. He is one of the best string instrument players He could not read music, but if he heard a tune a few times, he could play it. When he is younger, he was a member of a small country music band. They would play at local dances and on a few occasions would play for the local radio station. He often told us how he had auditioned and earned a position in a band the featured Patsy Cline as their lead singer. He told the family that after he is hired he never went back. Dad was a very religious man. He stated that there is a lot of drinking and cursing the day of his audition and he does not want to being around that type of environment</P>5         <P>My father was a self-taught mandolin player. He is one of the best string instrument players He could not read music, but if he heard a tune a few times, he could play it. When he is younger, he was a member of a small country music band. They would play at local dances and on a few occasions would play for the local radio station. He often told us how he had auditioned and earned a position in a band the featured Patsy Cline as their lead singer. He told the family that after he is hired he never went back. Dad was a very religious man. He stated that there is a lot of drinking and cursing the day of his audition and he does not want to being around that type of environment.</P>6     </Div>7 </BODY>

The normal display method is: the contents of each p tag will be covered with the width of the body, each row.

But with the multi-column style attribute in CSS3, the code:

. Main{/*set the width of each column*/-webkit-column-width:400px;/*divide the page into three columns*/-webkit-column-count:3;/*spacing between columns*/-webkit-column-gap:50px;/*set up column dividing line*/-webkit-column-rule:thin solid #999;-moz-column-rule:Thin Solid #999;-moz-column-count:3;Column-count:3; }

The results are as follows:

is not very simple ... That's it

CSS3 multi-column style layout

Related Article

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.