Skip to content

Instantly share code, notes, and snippets.

@ahmed1490
Forked from bbrochier/flex.md
Created December 2, 2016 13:49
Show Gist options
  • Save ahmed1490/c4b3540807b0dbaf27490efd55fbacec to your computer and use it in GitHub Desktop.
Save ahmed1490/c4b3540807b0dbaf27490efd55fbacec to your computer and use it in GitHub Desktop.
Flex

#CSS FLEXBOX

Summary of : http://la-cascade.ghost.io/flexbox-guide-complet/

1. Container

1.1 Init flex

display: flex | inline-flex;

1.2 Axis & wraping

alt text

flex-direction: row (default) | row-reverse | column | column-reverse
flex-wrap: nowrap (default) | wrap | wrap-reverse
flex-flow: <‘flex-direction’> || <‘flex-wrap’>

1.3 Justify

justify-content: flex-start (default) | flex-end | center | space-between | space-around

alt text

1.4 Alignement (on main axis)

align-items: flex-start | flex-end | center | baseline | stretch (default)

alt text

align-content: flex-start | flex-end | center | space-between | space-around | stretch (default)

alt text


2. Items

2.1 Order

https://developer.mozilla.org/en-US/docs/Web/CSS/order

order: <integer> (defaut: 0)

2.2 Flex

flex-grow: <integer> (defaut: 0)
flex-shrink: <integer> (defaut: 1)
flex-basis: <width> | auto (defaut)

Recommanded syntax

flex: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ] (default: 0 1 auto)

2.3 Alignement (on cross axis)

align-self: auto | flex-start | flex-end | center | baseline | stretch (default)
@ahmed1490
Copy link
Author

Known flexbox bugs and community workarounds

https://github.com/philipwalton/flexbugs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment