Column-count - CSS-Tricks
Có thể bạn quan tâm
If you need an exact numbers of columns when designing a multi-column layout, use column-count.
.lead { column-count: 3; }Given the number of columns, the browser will evenly distribute the content in exactly that number of columns.
This property can also be used in the shorthand for columns and can be used in tandem with column-width. When both properties are declared column-count is the maximum number of columns.
Values
column-count can be auto or an integer.
Use auto if you are also using column-width. Think of it as a way of telling the browser, to let column-width take the lead.
The integer, also known as the number of columns, must be greater than or equal to 0.
Unlike column-width this property will hold the number of columns regardless of the browser width. This means that if you pulled up a 5-columned layout on your mobile phone, you will have a very squished 5-columned layout to navigate. column-count works best alongside column-width.
Related Properties
- columns
- column-fill
- column-gap
- column-rule
- column-span
- column-width
Additional Resources
- MDN Docs
- CSS3 Spec
- Can I Use
Browser Support
Multi-column layout support:
Từ khóa » Html Grid Column Count
-
CSS Column-count Property - W3Schools
-
Grid-column - CSS: Cascading Style Sheets - MDN Web Docs
-
A Way To Count Columns In A Responsive Grid - Stack Overflow
-
CSS | Column-count Property - GeeksforGeeks
-
Learn Intermediate CSS: Grid Cheatsheet | Codecademy
-
Create An Adaptive CSS Grid With A Max Column Count! - YouTube
-
CSS Column-count Property - W3docs
-
CSS Column-count Property
-
When And How To Use CSS Multi-Column Layout
-
Grid - Semantic UI
-
Grid Cheatsheet
-
CSS · Bootstrap
-
Responsive CSS Grid Column Layout - Developapa
-
Responsive Grid System And Column Layout Based On Screen Size