Skip to content

Instantly share code, notes, and snippets.

@zlargon
Created November 21, 2015 08:50
Show Gist options
  • Save zlargon/e3ce83142d375389ebec to your computer and use it in GitHub Desktop.
Save zlargon/e3ce83142d375389ebec to your computer and use it in GitHub Desktop.
CSS Flexbox
.container {
display: flex; /* or inline-flex */
/* Flexbox is a single-direction layout concept */
flex-direction: row | row-reverse | column | column-reverse;
flex-wrap: nowrap | wrap | wrap-reverse;
flex-flow: <‘flex-direction’> || <‘flex-wrap’>;
/* main axis */
justify-content: flex-start | flex-end | center | space-between | space-around;
/* cross axis */
align-items: flex-start | flex-end | center | baseline | stretch; /* default stretch */
/* cross-axis */
/* Note: this property has no effect when there is only "one line" of flex items. */
align-content: flex-start | flex-end | center | space-between | space-around | stretch; /* default stretch */
}
.item {
order: <integer>; /* default 0 */
flex-grow: <number>; /* default 0 */
flex-shrink: <number>; /* default 1 */
flex-basis: <length> | auto; /* default auto */
flex: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ];
align-self: auto | flex-start | flex-end | center | baseline | stretch;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment