Multi-column Layout
suggest changeCSS Multi-column Layout flows one element's content through multiple columns:
.article {
columns: 18rem 3;
column-gap: 2rem;
column-rule: 1px solid color-mix(in srgb, currentColor 25%, transparent);
}
.article h2 {
break-after: avoid;
}
.article figure {
break-inside: avoid;
}
The columns shorthand combines a preferred column-width and maximum column-count. The browser chooses a count that fits the available space.
Multi-column layout is suited to continuous prose. It is generally a poor choice for interface cards because content flows vertically down one column and then into the next, which can make scanning and keyboard navigation confusing. Use Grid for independently ordered items.
Modern browsers support the multi-column properties without vendor prefixes.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents