↑
Original image by the amazing Lin Clarkhttp://bit.ly/detech-css
🥑 Developer Advocate 🥑
See the Pen #0: Pre-Grid layout techniques by Chen Hui Jing (@huijing) on CodePen.
flex
syntaxSee the Pen Flexbox basics by Chen Hui Jing (@huijing) on CodePen.
flex: initial |
flex: 0 1 auto , cannot grow but can shrink when there isn't enough space |
flex: auto |
flex: 1 1 auto , can grow and shrink to fit available space |
flex: none |
flex: 0 0 auto , cannot grow or shrink, AKA inflexible |
flex: <positive-number> |
flex: <positive-number> 1 0 , can grow and shrink, extent of growth depends on flex factor |
Authors are encouraged to control flexibility using the flex shorthand rather than with its longhand properties directly, as the shorthand correctly resets any unspecified components to accommodate common uses.
—CSS Flexible Box Layout Module Level 1
See the Pen Auto-margins in Flexbox by Chen Hui Jing (@huijing) on CodePen.
See the Pen Aligning flex items by Chen Hui Jing (@huijing) on CodePen.
See the Pen Image gallery by Chen Hui Jing (@huijing) on CodePen.
See the Pen #1: Defining a grid by Chen Hui Jing (@huijing) on CodePen.
repeat()
functionSee the Pen #2.1: The repeat() function by Chen Hui Jing (@huijing) on CodePen.
auto-fill
versus auto-fit
See the Pen #2.2: auto-fill versus auto-fit by Chen Hui Jing (@huijing) on CodePen.
grid-auto-row
and grid-auto-column
See the Pen #2.3: grid-auto-row and grid-auto-column by Chen Hui Jing (@huijing) on CodePen.
grid-auto-flow
propertySee the Pen #2.4: The grid-auto-flow property by Chen Hui Jing (@huijing) on CodePen.
fr
unitSee the Pen #3.1: The fr unit by Chen Hui Jing (@huijing) on CodePen.
minmax()
functionSee the Pen #3.2: The minmax() function by Chen Hui Jing (@huijing) on CodePen.
See the Pen #3.3: Content-based sizing by Chen Hui Jing (@huijing) on CodePen.
See the Pen Image gallery by Chen Hui Jing (@huijing) on CodePen.
See the Pen #4.1: Line-based placement by Chen Hui Jing (@huijing) on CodePen.
grid-column
and grid-row
See the Pen #4.2: grid-column and grid-row by Chen Hui Jing (@huijing) on CodePen.
span
keywordSee the Pen #4.3: The span keyword by Chen Hui Jing (@huijing) on CodePen.
grid-area
shorthandSee the Pen #4.4: Using the grid-area shorthand by Chen Hui Jing (@huijing) on CodePen.
See the Pen #5.1: Naming grid lines by Chen Hui Jing (@huijing) on CodePen.
See the Pen #5.2: Naming grid areas by Chen Hui Jing (@huijing) on CodePen.
See the Pen Responsive dashboard by Chen Hui Jing (@huijing) on CodePen.
Do we have enough time?
.selector {
/* Styles that are supported in old browsers */
}
@supports (property:value) {
.selector {
/* Styles for browsers that support the specified property */
}
}
See the Pen Card-based layout by Chen Hui Jing (@huijing) on CodePen.
Font used is ABeeZee, by Anja Meiners