0% found this document useful (0 votes)
2K views

Flexbox Cheatsheet PDF

This document provides a cheatsheet for flexbox properties including: 1. Flex container properties like display, flex-direction, justify-content and align-items. 2. Flex item properties like flex-grow, flex-shrink, flex-basis, order and align-self. 3. Browser support details and workarounds for bugs in older browsers like Internet Explorer. 4. Examples of layout patterns that can be created using flexbox like a mono-line grid, media object and centering content.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views

Flexbox Cheatsheet PDF

This document provides a cheatsheet for flexbox properties including: 1. Flex container properties like display, flex-direction, justify-content and align-items. 2. Flex item properties like flex-grow, flex-shrink, flex-basis, order and align-self. 3. Browser support details and workarounds for bugs in older browsers like Internet Explorer. 4. Examples of layout patterns that can be created using flexbox like a mono-line grid, media object and centering content.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

flexbox cheatsheet by @alsacreations

display flex-wrap flex-grow flex-shrink flex-basis


flex-container properties

flex-item properties
flex· inline-flex nowrap· wrap· wrap-reverse 0· 1· 2· … 0· 1· 2· … auto· value· fill· min-content· …
flex-direction flex (= flex-grow flex-shrink flex-basis)
row· row-reverse· column· column-reverse flex: initial; ⇢ flex: 0 1 auto;

flex: auto; ⇢ flex: 1 1 auto;

justify-content flex: none; ⇢ flex: 0 0 auto;

flex-start· flex-end· center· space-between· space-around flex: value; ⇢ flex: value 1 0;
align-items order
flex-start· flex-end· center· stretch· baseline 0· 1· 2· …

align-content align-self
flex-start· flex-end· center· stretch· space-between· space-around auto· flex-start· flex-end· center· stretch· baseline

Chrome 20- (old)



internet explorer bugs

browsers support
don’t do min-width | min-height

priority prevalence
1
21+ (new)
Safari 3.1+ (old)
 2 max-width | max-height
.parent { flex: 1;} .parent { flex: 1 1 0%;} IE10-11
6.1+ (new)

Firefox 2-21 (old) 3 flex-wrap
.parent { flex: 1 1 0;} .parent { flex: 1 1 0%;} IE10 22+ (new)
Internet 10 (tweener) 4 flex-grow | flex-shrink
.inline-child { …} .inline-child { display: block;} IE10-11 Explorer 11+ (new)
Android 2.1+ (old) 5 flex-basis: value;
flex-basis: value;
 width|height: value;
 4.4+ (new)
IE10-11
box-sizing: border-box; box-sizing: border-box iOS 3.2+ (old) 6 width: value;
7.1+ (new)
flex-basis: calc(value); width|height: calc(value); IE10-11 Opera 12.1+ (new) 7 flex-basis: auto;
https://github.com/philipwalton/flexbugs

option 1 : flexible children option 2 : space-between


mono-line grid

without gutters: .parent { .children { without gutters: .parent { .children {


display: flex; flex: 1 1 0%; display: flex; width: calc(100% / 3);
} } } }

.parent { .children { .parent {


with gutters: with gutters:
display: flex; flex: 1 1 0%; display: flex;
} } justify-content: space-between;
}
.parent > *:not(:first-child) {
margin-left: gutter; .children {
} width: calc(100% / 3 - gutter / 2);
}

media object center everything


patterns

Lorem Elsass Ipsum mitt


.parent { .content { .parent {
picon bière munster du display: flex; flex: 1 1 0%; display: flex;
ftomi! Ponchour bisame.
Bibbeleskaas jetz align-items: flex-start; } justify-content: center;
rossbolla sech
choucroute un schwanz. } align-items: center;
}

modifiers: .parent--reverse { .figure--center { alternative: .parent { .children {


flex-direction: row-reverse; align-self: center; display: flex; margin: auto;
} } } }

english flex-container
unapplied properties
resources

• Awesome Flexbox: https://github.com/afonsopacifer/awesome-flexbox • column-*


• A complete guide to Flexbox: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
flex-item
• Flexbox Patterns: http://www.flexboxpatterns.com/
• float
francophone • clear
• Flexbox Layout : http://kiwi.gg/flexbox • vertical-align
• Flexbox, guide complet : https://la-cascade.io/flexbox-guide-complet/ • ::first-line· ::first-letter
• Livre « Flexbox, plongez dans les CSS modernes » : http://goetter.fr/livres/flexbox/

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy