CSS Flexible Box Layout Module (Flexbox)
- Flexbox Terminology
- Flex Container
- Display
- Orientation
- Alignment
- Flex Item
- Demo
Flexbox Terminology
Reference: W3C
Terminology:
- Flex container
- Flex item
- Main axis (main-start, main-end)
- Cross axis (cross-start, cross-end)
Display
Name: display
Value: flex | inline-flex
Initial: inline
Example
Flex Container - Orientation Direction
Name: flex-direction
Value: row | row-reverse | column | column-reverse
Initial: row
Example
Flex Container - Orientation Wrap
Name: flex-wrap
Value: nowrap | wrap | wrap-reverse
Initial: nowrap
Example
Flex Container - Orientation Direction & Wrap
Name: flex-flow
Value:<flex-direction>
||<flex-wrap>
Initial: individual properties
Example
Flex Container - Alignment Content (Justify)
Name: justify-content
Value: flex-start | flex-end | center | space-between | space-around
Initial: flex-start
Example
Flex Container - Alignment Items
Name: align-items
Value: flex-start | flex-end | center | baseline | stretch
Initial: stretch
Example
Flex Container - Alignment Content
Name: align-content
Value: flex-start | flex-end | center | space-between | space-around | stretch
Initial: stretch
Example
Flex Item - Alignment Self
Name: align-self
Value: auto | flex-start | flex-end | center | baseline | stretch
Initial: auto
Example
Flex Item - Ordering
Name: order
Value:<integer>
Initial: 0
Example
Flex Item - Flexibility Grow
Name: flex-grow
Value:<integer>
Initial: 0
Example
Flex Item - Flexibility Shrink
Name: flex-shrink
Value:<integer>
Initial: 1
Example
flexibility-shrink/index.html:
Flex Item - Flexibility Basis
Name: flex-basis
Value: content |<width>
Initial: auto
Example
Flex Item - Flexibility Shorthand
Name: flex
Value: none | [<flex-grow>
<flex-shrink>
? ||<flex-basis>
]
Initial: 0 1 auto
Example
Demo
References
- CSS Flexible Box Layout Module Level 1 | W3C
- CSS Box Alignment Module Level 3 | W3C
- CSS Flexible Box Layout | MDN
- Basic concepts of flexbox | MDN
- A Complete Guide to Flexbox | css-tricks
- CSS Flexible Box Layout Module | Can I Use
- Build a Minimalist HTML Card in just 53 lines of code (with Flexbox)
- How Flexbox works — explained with big, colorful, animated gifs
- Flexbox - The Ultimate CSS Flex Cheatsheet (with animated diagrams!)
- Learn CSS Flexbox in 5 Minutes
- Flexbox Cheat Sheet
- Flexbox - A friendly tutorial for modern CSS layouts
- Flexbox - Use Flexbox para levar a criação de layouts CSS ao próximo nível
- Guia Flexbox
- Flexbox in CSS | cssreference
- Flexbox - Align last itemin grid to the left
- Animated Flexbox (1, 2)
- The Complete Illustrated Flexbox Tutorial 👍
- Flexbox — The Animated Tutorial
- CSS Flex—An Interactive Tutorial
- Flexbox Playground
- Flex Guide
- Meet the first visual flexbox builder
- Flexbox — The Animated Tutorial