This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.
Smartphone icons created by Freepik - Flaticon
The CSS multi-column layout allows easy definition of multiple columns of text - just like in newspapers:
I have learned a few things about Cascading Style Sheets that I did not know existed. For instance, I did not know multiple images may be used as background images
I also learned how to make basic animations using CSS. This will be a great asset to know how to do. I can imagine what I may do with animated banners using a mixture of text and images.
I also learned to make inline unordered lists. This will be great for creating navigation bars. Another advanced navigation option is horizontal links as blocks stacked, one on top of the other.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.In this chapter you will learn about the following multi-column properties:
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
column-count | 50.0 | 10.0 | 52.0 | 9.0 | 37.0 |
column-gap | 50.0 | 10.0 | 52.0 | 9.0 | 37.0 |
column-rule | 50.0 | 10.0 | 52.0 | 9.0 | 37.0 |
column-rule-color | 50.0 | 10.0 | 52.0 | 9.0 | 37.0 |
column-rule-style | 50.0 | 10.0 | 52.0 | 9.0 | 37.0 |
column-rule-width | 50.0 | 10.0 | 52.0 | 9.0 | 37.0 |
column-span | 50.0 | 10.0 | 71.0 | 9.0 | 37.0 |
column-width | 50.0 | 10.0 | 52.0 | 9.0 | 37.0 |
The column-count property specifies the number of columns an element should be divided into. The following example will divide the text in the <div> element into 3 columns:
div { column-count: 3; }
The column-gap property specifies the gap between the columns. The following example specifies a 40 pixels gap between the columns:
div { column-gap: 40px; }
The
property specifies the style of the rule between columns:div { column-rule-style: solid; }
The
property specifies the width of the rule between columns:div { column-rule-width: 1px; }
The
property specifies the color of the rule between columns:div { column-rule-color: lightblue; }
The
property is a shorthand property for setting all the column-rule-* properties above. The following example sets the width, style, and color of the rule between columns:div { column-rule: 1px solid lightblue; }
The
property specifies how many columns an element should span across. The following example specifies that the <h2> element should span across all columns:h2 { column-span: all; }
The
property specifies a suggested, optimal width for the columns. The following example specifies that the suggested, optimal width for the columns should be 100px:div { column-width: 100px; }
The following table lists all the multi-columns properties:
Property | Description |
---|---|
column-count | Specifies the number of columns an element should be divided into |
column-fill | Specifies how to fill columns |
column-gap | Specifies the gap between the columns |
column-rule | A shorthand property for setting all the column-rule-* properties |
column-rule-color | Specifies the color of the rule between columns |
column-rule-style | Specifies the style of the rule between columns |
column-rule-width | Specifies the width of the rule between columns |
column-span | Specifies how many columns an element should span across |
column-width | Specifies a suggested, optimal width for the columns |
columns | A shorthand property for setting column-width and column-count |