SlideShare ist ein Scribd-Unternehmen logo
1 von 65
Downloaden Sie, um offline zu lesen
FLEXBOX
1
CONTENT-DRIVEN
LAYOUTS WITH
CHRIS
SAUVE
2
LAYOUT
STRATEGIES
3
ABSOLUTE
POSITIONING
4
INLINE BLOCK
5
FLOATS
6
THINK
DIFFERENT
7
CONTENT-OUT
LAYOUT
8
BROWSER
SUPPORT
9
YES YESYES10+ only
-ms	in	IE10
YES
even	in	Mini!
10
YES YESYES10+ only
-ms	in	IE10
YES
even	in	Mini!
CAN I USE SAYS…
95.44%
11
PARENT
RULES
12
display:	flex;	//	or	inline-flex
flex-direction:	row;	//	or	column
13
1 2 3
flex-direction:	row;
14
1
2
3
flex-direction:	column;
15
display:	flex;	//	or	inline-flex
flex-direction:	row;	//	or	column
16
display:	flex;	//	or	inline-flex
flex-direction:	row;	//	or	column
justify-content:	center;
17
1 2 3
Main Axis
justify-content
18
1 2 3
justify-content:	center;
19
1 2 3
justify-content:	flex-start;
20
1 2 3
justify-content:	flex-end;
21
1 2 3
justify-content:	space-between;
22
1 2 3
justify-content:	space-around;
23
display:	flex;	//	or	inline-flex
flex-direction:	row;	//	or	column
justify-content:	center;
24
display:	flex;	//	or	inline-flex
flex-direction:	row;	//	or	column
justify-content:	center;
align-items:	stretch;
25
1 2 3
Cross Axis
align-items
26
1 2 3
align-items:	stretch;	//	default
27
1 2 3
align-items:	center;
28
1 2 3
align-items:	flex-start;
29
1 2 3
align-items:	flex-end;
30
display:	flex;	//	or	inline-flex
flex-direction:	row;	//	or	column
align-items:	stretch;
justify-content:	center;
31
display:	flex;	//	or	inline-flex
flex-direction:	row;	//	or	column
align-items:	stretch;
justify-content:	center;
flex-wrap:	nowrap;
32
1 2 3
flex-wrap:	nowrap;
33
1 2
3
flex-wrap:	wrap;
34
CHILD
RULES
35
flex-grow:	0;
flex-shrink:	0;
flex-basis:	auto;
36
flex:	<grow>	<shrink>	<basis>;
//	or
flex-basis:	<length>;
flex-basis:	auto;
width:	<length>;
37
//	roughly	equivalent	to:
1 2 3
100px
20px 20px 20px
38
1 2 3
100px
20px 20px 20px
40px of “growth” available
39
1 2 3
flex-grow:	0; flex-grow:	0; flex-grow:	0;
40
1 2 3
flex-grow:	1;
13px of growth
flex-grow:	1;
13px of growth
flex-grow:	1;
13px of growth
41
1 2 3
flex-grow:	1;
10px of growth
flex-grow:	2;
20px of growth
flex-grow:	1;
10px of growth
42
1 2 3
flex-grow:	0;
0px of growth
flex-grow:	1;
20px of growth
flex-grow:	1;
20px of growth
43
1 2 3
40px
20px 20px 20px
44
1 2 3
40px
20px 20px 20px
20px of “shrink” available
45
flex-shrink:	0; flex-shrink:	0; flex-shrink:	0;
1 2 3
46
flex-shrink:	0; flex-shrink:	1; flex-shrink:	1;
1
0px of shrink 10px of shrink 10px of shrink
47
NO SILVER
BULLET
48
AWESOME
EXAMPLES
49
PAGE
LAYOUT
50
Play with the Codepen
codepen.io/lemonmade/pen/RNEpJR?editors=110
GOAL
51
52
Header
ContentSidebar
Footer
GOAL
SMART
POPOVERS
53
Play with the Codepen
codepen.io/lemonmade/pen/XJobem?editors=110
54
55
WRAPPABLE
LAYOUTS
Play with the Codepen
codepen.io/lemonmade/pen/XXWZBr?editors=110
56
REFLOWING
HEADER
57
Play with the Codepen
codepen.io/lemonmade/pen/ZYgNmy?editors=110
58
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
CSS-TRICKS
REFERENCE
59
AUTOPREFIXER
https://github.com/philipwalton/flexbugs
60
FLEXBUGS
https://github.com/philipwalton/flexbugs
61
FLEXBOXFROGGY
http://flexboxfroggy.com
62
CHRIS
SAUVE
@_lemonmade
63
SHOPIFY
shopify.com/careers
64
THANKS
EVERYONE!
65

Weitere ähnliche Inhalte

Andere mochten auch

Utter failures and lessons remained unlearned
Utter failures and lessons remained unlearnedUtter failures and lessons remained unlearned
Utter failures and lessons remained unlearned
Ilari Henrik Aegerter
 

Andere mochten auch (12)

Exploring ideas
Exploring ideasExploring ideas
Exploring ideas
 
Paper - "Esperienza utente e fruizione dei contenuti nei quotidiani online i...
Paper - "Esperienza utente e fruizione dei contenuti nei  quotidiani online i...Paper - "Esperienza utente e fruizione dei contenuti nei  quotidiani online i...
Paper - "Esperienza utente e fruizione dei contenuti nei quotidiani online i...
 
Adaptive, Responsive, Mobile. A liquid web.
Adaptive, Responsive, Mobile. A liquid web.Adaptive, Responsive, Mobile. A liquid web.
Adaptive, Responsive, Mobile. A liquid web.
 
Mobile last
Mobile lastMobile last
Mobile last
 
What future we want for our Software Industry?
What future we want for our Software Industry?What future we want for our Software Industry?
What future we want for our Software Industry?
 
Style Guides, Pattern Libraries, Design Systems and other amenities.
 Style Guides, Pattern Libraries, Design Systems and other amenities. Style Guides, Pattern Libraries, Design Systems and other amenities.
Style Guides, Pattern Libraries, Design Systems and other amenities.
 
Understanding flexbox
Understanding flexboxUnderstanding flexbox
Understanding flexbox
 
Interface Fundamentals
Interface FundamentalsInterface Fundamentals
Interface Fundamentals
 
Utter failures and lessons remained unlearned
Utter failures and lessons remained unlearnedUtter failures and lessons remained unlearned
Utter failures and lessons remained unlearned
 
DevOps in PHP environment
DevOps in PHP environmentDevOps in PHP environment
DevOps in PHP environment
 
Information Architecture Fundamentals
Information Architecture FundamentalsInformation Architecture Fundamentals
Information Architecture Fundamentals
 
The Mission of the Coalition of Residential Excellence
The Mission of the Coalition of Residential Excellence The Mission of the Coalition of Residential Excellence
The Mission of the Coalition of Residential Excellence
 

Kürzlich hochgeladen

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Content-Driven Layouts with Flexbox (Chris Sauve, CSSDay 2015)