
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
How to arrange text in multi-columns using CSS3?
To arrange text in multi-columns we are using the “column-count” property of CSS3. The “column-count” property is used to divide an HTML element’s content into the number of columns specified. Here we are going to use two different example to demonstrate the application of “colum count” property of CSS to arrange text in 2 and 3 columns.
Syntax
column-count: n;
Here, “n” is the positive integer value that represents the number of columns we want to arrange the text into.
Example 1
In this example, we will arrange a “p” tag’s content into 3 columns by using the “column-count” property of CSS3.
<!DOCTYPE html> <html lang="en"> <head> <title>How to arrange text in multi columns using CSS3?</title> <style> .para { column-count: 3; } </style> </head> <body> <h3>How to arrange text in multi columns using CSS3?</h3> <p class="para">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nihil architecto ratione cumque consequatur at fugit saepe, unde temporibus laudantium, incidunt sit possimus quidem soluta facere repellat dolore facilis, consectetur repudiandae.</p> </body> </html>
Example 2
In this example, we will arrange a “p” tag’s content into 2 columns by using the “column-count” property of CSS3.
<!DOCTYPE html> <html lang="en"> <head> <title>How to arrange text in multi columns using CSS3?</title> <style> .para { column-count: 2; } </style> </head> <body> <h3>How to arrange text in multi columns using CSS3?</h3> <p class="para"> <span>Lorem ipsum dolor sit amet consectetur adipisicing elit. Nihil architecto ratione cumque consequatur at fugit saepe, unde temporibus laudantium, incidunt sit possimus quidem soluta facere repellat dolore facilis, consectetur repudiandae.</span> <span>Lorem ipsum dolor sit amet consectetur adipisicing elit. Nihil architecto ratione cumque consequatur at fugit saepe, unde temporibus laudantium, incidunt sit possimus quidem soluta facere repellat dolore facilis, consectetur repudiandae.</span> <span>Lorem ipsum dolor sit amet consectetur adipisicing elit. Nihil architecto ratione cumque consequatur at fugit saepe, unde temporibus laudantium, incidunt sit possimus quidem soluta facere repellat dolore facilis, consectetur repudiandae.</span> </p> </body> </html>
Conclusion
In this article, we learned what is “column-count” property, is and how we can use it to arrange text into multiple columns using CSS3. In the first example, we arranged the text in 3 columns by setting the “column-count” property to 3, and in the second example, we arranged the text in 3 columns by setting the “column-count” property to 2.
- Related Articles
- How to limit input text length using CSS3?
- Text in Transparent Box using CSS3
- Breaking Overflow Text using CSS3
- CSS3 Multi color Gradients
- CSS3 Multi-Column Property
- Arrange two or more colors in linear formats using CSS3 Gradients
- CSS3 Multi-Column rule-width Property
- CSS3 Multi-Column rule-style Property
- CSS3 Multi-Column column-count Property
- CSS3 Multi-Column column-rule Property
- CSS3 Multi-Column column-fill Property
- CSS3 Multi-Column column-gap Property
- CSS3 Multi-Column rule-color Property
- CSS3 Multi-Column column-span Property
- How to Create a Multi-line Text Input (Text Area) In HTML?
