🥑 Developer Advocate 🥑
designed for laying out documents
designed for laying out text
designed for laying out 2D data in a tabular format
designed for very explicit positioning without much regard for other elements in the document
describes a CSS box model optimised for user interface design and designed for laying out more complex applications and webpages
为用户界面设计的布局模型;可以对齐主轴或交叉轴上的项目,从而提供对一组项目大小和对齐的高级控制
Defines a two-dimensional grid-based layout system, optimised for user interface design.
二维网格布局系统,为用户界面设计的布局模型
“Grid works from the container in,
other layout methods start with the item”
—Rachel Andrew
inline-block
Item A
Item B
Item C
Item D
Item E
Item F
float
Item A
Item B
Item C
Item D
Item E
Item F
flex
Item A
Item B
Item C
Item D
Item E
Item F
Grid is the only layout technique that establishes a relationship between rows and columns of grid items.
只有Grid中的行列才是真實的,是有關係的。
Define your grid.
建立格線容器
Place items in the grid.
放置格線單元
Same properties, more values
grid-template-columns: subgrid <line-name-list>?
grid-template-rows: subgrid <line-name-list>?
The subgrid
keyword indicates to the browser the nested grid will use the same sizing as its parent along the relevant axis.
.subgrid-container {
grid-columns: 2 / 5; /* placement for the subgrid container itself */
display: grid; /* you must still apply a display: grid to the subgrid */
grid-template-columns: subgrid;
grid-template-rows: subgrid;
}
Header font is Ostrich Sans by Tyler Finck.
Body font is Libre Baskerville by Pablo Impallari.