Multi-column
Multi-column layout splits content into columns, like a newspaper. It is the third CSS layout system alongside flex and grid.
- columns: shorthand for column-count and column-width. With a width, it creates as many columns as fit.
- column-gap: space between columns.
- column-rule: dividing line between columns, with the same syntax as border.
- column-span: all: makes an element, such as a heading, span every column.
- break-inside: avoid: stops an element from being split between two columns.
Example
Change columns on the container. A number sets how many columns there are; a width such as 10rem lets the browser create as many as fit. Try that last option while moving the width control.
ResultLive
html
css