SlideShare a Scribd company logo
flex in flux
The Flexbox Layout CSS module aims to provide a more efficient way to
lay out, align and distribute space among items in a container, even when
their size is unknown and/or dynamic.
- Chris Coyier

Flexible box layout model
W3C working draft, 23 July 2009
Revised in 2012
Sounds pretty neat, huh?
What is flexbox?
OMG! Flexbox is coming.
RUN!
Flexbox is awesome. So why aren’t we all using it all the time?
Nobody puts flexi in the corner
- It’s pretty complex
- It’s fundamentally different (to how we’ve always done layout)
- It’s not that well supported by browsers
Firefox
Full support 40+
Edge
Full support
Chrome
Full support 43+
Android browser
Full support 4.4+

Pre-4.4 supports ‘old style’
Internet Explorer
Full support 11+
Opera
Full support
Safari
Full support 8+
iOS Safari
Full support 9.1+

Prefixed support from 8.4
1) Make a flexbox container
The basics
display: flex;
2) Add items inside the container
<div> <aside> <section>
The flexbox container
flex-direction: row | row-reverse | column | column-reverse;
row
row-reverse
column column-reverse
The flexbox container
#box-one #box-two #box-three
#box-four #box-five
The flexbox container
flex-wrap: nowrap | wrap | wrap-reverse;
Flexbox items
By default flex items are displayed by source order. We can change this.
#box-one #box-two #box-three
Flexbox items
order: x
#box-one
order: 2;
#box-three
order: 1;
#box-two
order: 66;
Setting this to 1 (or more) allows the items to ‘grow’ to fit the container.
flex-grow: <number> /* Default: 0 */
flex-grow: 1; flex-grow: 1; flex-grow: 1;
flex-grow: 0; flex-grow: 0; flex-grow: 0;
Flexbox items
This allows an item to ‘shrink’ proportionally within the container if it needs to.
flex-shrink: <number> /* Default: 1 */
flex-grow: 1;
width: 35%;
flex-grow: 1;
width: 35%;
flex-shrink: 1;
Flexbox items
This defines the default size of an element before the remaining space is distributed.
It can be a length (e.g. 20%, 5rem, etc.) or a keyword.
flex-basis: 50%; flex-basis: auto;
flex-basis: x
Flexbox items
Float, clear, vertical-align
have no effect on a flex item.
There’s no combo, mix ’n’ match css here.
You go 100% flexbox or you go home.
Beware, beware
!!!! !
We can nest flex containers. This opens up the potential for some pretty insane layouts.
How deep is your flex?
within flex within flex within flex within flex within flex withi
Foundation 6 has an optional grid system built
with flexbox. The old grid system remains.
However…
The W3C strongly suggest that Flexbox should
be used to layout individual web components
and not full page layouts.
We have the CSS grid layout for that.
That’s another show & tell entirely.
Are we there yet?
Flexbox is finally ready for the big time.
And we’re finally ready for flexbox.

More Related Content

Similar to Show & tell - Flex in flux

Putting Flexbox into Practice (Fronteers)
Putting Flexbox into Practice (Fronteers)Putting Flexbox into Practice (Fronteers)
Putting Flexbox into Practice (Fronteers)
Zoe Gillenwater
 
Leveling Up with Flexbox (Smashing Conference)
Leveling Up with Flexbox (Smashing Conference)Leveling Up with Flexbox (Smashing Conference)
Leveling Up with Flexbox (Smashing Conference)
Zoe Gillenwater
 
Using Flexbox Today (CSS Summit 2016)
Using Flexbox Today (CSS Summit 2016)Using Flexbox Today (CSS Summit 2016)
Using Flexbox Today (CSS Summit 2016)
Zoe Gillenwater
 
Leveling Up With Flexbox (Smart Web Conference)
Leveling Up With Flexbox (Smart Web Conference)Leveling Up With Flexbox (Smart Web Conference)
Leveling Up With Flexbox (Smart Web Conference)
Zoe Gillenwater
 
Putting Flexbox into Practice
Putting Flexbox into PracticePutting Flexbox into Practice
Putting Flexbox into Practice
Zoe Gillenwater
 
Flexbox Will Shock You!
Flexbox Will Shock You!Flexbox Will Shock You!
Flexbox Will Shock You!
Scott Vandehey
 
CSS Flexbox (flexible box layout)
CSS Flexbox (flexible box layout)CSS Flexbox (flexible box layout)
CSS Flexbox (flexible box layout)
Woodridge Software
 
A complete guide to flexbox
A complete guide to flexboxA complete guide to flexbox
A complete guide to flexbox
Bytes Technolab Inc.
 
Enhancing Responsiveness with Flexbox (RWD Summit)
Enhancing Responsiveness with Flexbox (RWD Summit)Enhancing Responsiveness with Flexbox (RWD Summit)
Enhancing Responsiveness with Flexbox (RWD Summit)
Zoe Gillenwater
 
Is Flexbox the Future of Layout -bdconf
Is Flexbox the Future of Layout -bdconfIs Flexbox the Future of Layout -bdconf
Is Flexbox the Future of Layout -bdconf
jameswillweb
 
Understanding the flex layout
Understanding the flex layoutUnderstanding the flex layout
Understanding the flex layout
Barak Drechsler
 
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
Kobkrit Viriyayudhakorn
 
Intro to Flexbox with Real Word Examples
Intro to Flexbox with Real Word ExamplesIntro to Flexbox with Real Word Examples
Intro to Flexbox with Real Word Examples
Jennifer Bland
 
Introduction to css flexbox
Introduction to css flexboxIntroduction to css flexbox
Introduction to css flexbox
Markandan R
 
Understanding flexbox
Understanding flexboxUnderstanding flexbox
Understanding flexbox
mustafa sarac
 
Flex box
Flex boxFlex box
Flex box
Harish Karthick
 
Using Flexbox Today (Frontend United 2016)
Using Flexbox Today (Frontend United 2016)Using Flexbox Today (Frontend United 2016)
Using Flexbox Today (Frontend United 2016)
Zoe Gillenwater
 
#4 HTML & CSS [know-how]
#4 HTML & CSS [know-how]#4 HTML & CSS [know-how]
#4 HTML & CSS [know-how]
Dalibor Gogic
 
Intro to Flexbox - A Magical CSS Property
Intro to Flexbox - A Magical CSS PropertyIntro to Flexbox - A Magical CSS Property
Intro to Flexbox - A Magical CSS Property
Adam Soucie
 
#2 - CSS Layouts Overview
#2 - CSS Layouts Overview#2 - CSS Layouts Overview
#2 - CSS Layouts Overview
iloveigloo
 

Similar to Show & tell - Flex in flux (20)

Putting Flexbox into Practice (Fronteers)
Putting Flexbox into Practice (Fronteers)Putting Flexbox into Practice (Fronteers)
Putting Flexbox into Practice (Fronteers)
 
Leveling Up with Flexbox (Smashing Conference)
Leveling Up with Flexbox (Smashing Conference)Leveling Up with Flexbox (Smashing Conference)
Leveling Up with Flexbox (Smashing Conference)
 
Using Flexbox Today (CSS Summit 2016)
Using Flexbox Today (CSS Summit 2016)Using Flexbox Today (CSS Summit 2016)
Using Flexbox Today (CSS Summit 2016)
 
Leveling Up With Flexbox (Smart Web Conference)
Leveling Up With Flexbox (Smart Web Conference)Leveling Up With Flexbox (Smart Web Conference)
Leveling Up With Flexbox (Smart Web Conference)
 
Putting Flexbox into Practice
Putting Flexbox into PracticePutting Flexbox into Practice
Putting Flexbox into Practice
 
Flexbox Will Shock You!
Flexbox Will Shock You!Flexbox Will Shock You!
Flexbox Will Shock You!
 
CSS Flexbox (flexible box layout)
CSS Flexbox (flexible box layout)CSS Flexbox (flexible box layout)
CSS Flexbox (flexible box layout)
 
A complete guide to flexbox
A complete guide to flexboxA complete guide to flexbox
A complete guide to flexbox
 
Enhancing Responsiveness with Flexbox (RWD Summit)
Enhancing Responsiveness with Flexbox (RWD Summit)Enhancing Responsiveness with Flexbox (RWD Summit)
Enhancing Responsiveness with Flexbox (RWD Summit)
 
Is Flexbox the Future of Layout -bdconf
Is Flexbox the Future of Layout -bdconfIs Flexbox the Future of Layout -bdconf
Is Flexbox the Future of Layout -bdconf
 
Understanding the flex layout
Understanding the flex layoutUnderstanding the flex layout
Understanding the flex layout
 
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
 
Intro to Flexbox with Real Word Examples
Intro to Flexbox with Real Word ExamplesIntro to Flexbox with Real Word Examples
Intro to Flexbox with Real Word Examples
 
Introduction to css flexbox
Introduction to css flexboxIntroduction to css flexbox
Introduction to css flexbox
 
Understanding flexbox
Understanding flexboxUnderstanding flexbox
Understanding flexbox
 
Flex box
Flex boxFlex box
Flex box
 
Using Flexbox Today (Frontend United 2016)
Using Flexbox Today (Frontend United 2016)Using Flexbox Today (Frontend United 2016)
Using Flexbox Today (Frontend United 2016)
 
#4 HTML & CSS [know-how]
#4 HTML & CSS [know-how]#4 HTML & CSS [know-how]
#4 HTML & CSS [know-how]
 
Intro to Flexbox - A Magical CSS Property
Intro to Flexbox - A Magical CSS PropertyIntro to Flexbox - A Magical CSS Property
Intro to Flexbox - A Magical CSS Property
 
#2 - CSS Layouts Overview
#2 - CSS Layouts Overview#2 - CSS Layouts Overview
#2 - CSS Layouts Overview
 

More from Dan Dineen

S&T What I know about Node 110817
S&T What I know about Node 110817S&T What I know about Node 110817
S&T What I know about Node 110817
Dan Dineen
 
S&T Pair up suckaz 070417
S&T Pair up suckaz 070417S&T Pair up suckaz 070417
S&T Pair up suckaz 070417
Dan Dineen
 
S&T Pixel imperfect 150716
S&T Pixel imperfect 150716S&T Pixel imperfect 150716
S&T Pixel imperfect 150716
Dan Dineen
 
S&T 15 minutes of fame 240317
S&T 15 minutes of fame 240317S&T 15 minutes of fame 240317
S&T 15 minutes of fame 240317
Dan Dineen
 
S&T Bugs 021216
S&T Bugs 021216S&T Bugs 021216
S&T Bugs 021216
Dan Dineen
 
S&T Ess Vee Gee 211016
S&T Ess Vee Gee 211016S&T Ess Vee Gee 211016
S&T Ess Vee Gee 211016
Dan Dineen
 
Show & tell - Pinned item curation
Show & tell - Pinned item curationShow & tell - Pinned item curation
Show & tell - Pinned item curation
Dan Dineen
 
Show & tell - Summary section user testing
Show & tell - Summary section user testingShow & tell - Summary section user testing
Show & tell - Summary section user testing
Dan Dineen
 
Show & tell - A new CMS infrastructure
Show & tell - A new CMS infrastructureShow & tell - A new CMS infrastructure
Show & tell - A new CMS infrastructure
Dan Dineen
 
Show & tell - The Foundry typefaces
Show & tell - The Foundry typefacesShow & tell - The Foundry typefaces
Show & tell - The Foundry typefaces
Dan Dineen
 
Show & tell - Who is Hugo?
Show & tell - Who is Hugo?Show & tell - Who is Hugo?
Show & tell - Who is Hugo?
Dan Dineen
 
Show & tell - The mighty hyphen
Show & tell - The mighty hyphenShow & tell - The mighty hyphen
Show & tell - The mighty hyphen
Dan Dineen
 
Show & tell - The anatomy of a responsive website
Show & tell - The anatomy of a responsive websiteShow & tell - The anatomy of a responsive website
Show & tell - The anatomy of a responsive website
Dan Dineen
 
Show & tell - Less stuff
Show & tell - Less stuffShow & tell - Less stuff
Show & tell - Less stuff
Dan Dineen
 
Show & tell - Covert accessibility
Show & tell - Covert accessibilityShow & tell - Covert accessibility
Show & tell - Covert accessibility
Dan Dineen
 
Show & tell - All the small things
Show & tell - All the small thingsShow & tell - All the small things
Show & tell - All the small things
Dan Dineen
 
Show & tell - A more accessible accordion
Show & tell - A more accessible accordionShow & tell - A more accessible accordion
Show & tell - A more accessible accordion
Dan Dineen
 
Show & tell - 16 pixels of pain
Show & tell - 16 pixels of painShow & tell - 16 pixels of pain
Show & tell - 16 pixels of pain
Dan Dineen
 

More from Dan Dineen (18)

S&T What I know about Node 110817
S&T What I know about Node 110817S&T What I know about Node 110817
S&T What I know about Node 110817
 
S&T Pair up suckaz 070417
S&T Pair up suckaz 070417S&T Pair up suckaz 070417
S&T Pair up suckaz 070417
 
S&T Pixel imperfect 150716
S&T Pixel imperfect 150716S&T Pixel imperfect 150716
S&T Pixel imperfect 150716
 
S&T 15 minutes of fame 240317
S&T 15 minutes of fame 240317S&T 15 minutes of fame 240317
S&T 15 minutes of fame 240317
 
S&T Bugs 021216
S&T Bugs 021216S&T Bugs 021216
S&T Bugs 021216
 
S&T Ess Vee Gee 211016
S&T Ess Vee Gee 211016S&T Ess Vee Gee 211016
S&T Ess Vee Gee 211016
 
Show & tell - Pinned item curation
Show & tell - Pinned item curationShow & tell - Pinned item curation
Show & tell - Pinned item curation
 
Show & tell - Summary section user testing
Show & tell - Summary section user testingShow & tell - Summary section user testing
Show & tell - Summary section user testing
 
Show & tell - A new CMS infrastructure
Show & tell - A new CMS infrastructureShow & tell - A new CMS infrastructure
Show & tell - A new CMS infrastructure
 
Show & tell - The Foundry typefaces
Show & tell - The Foundry typefacesShow & tell - The Foundry typefaces
Show & tell - The Foundry typefaces
 
Show & tell - Who is Hugo?
Show & tell - Who is Hugo?Show & tell - Who is Hugo?
Show & tell - Who is Hugo?
 
Show & tell - The mighty hyphen
Show & tell - The mighty hyphenShow & tell - The mighty hyphen
Show & tell - The mighty hyphen
 
Show & tell - The anatomy of a responsive website
Show & tell - The anatomy of a responsive websiteShow & tell - The anatomy of a responsive website
Show & tell - The anatomy of a responsive website
 
Show & tell - Less stuff
Show & tell - Less stuffShow & tell - Less stuff
Show & tell - Less stuff
 
Show & tell - Covert accessibility
Show & tell - Covert accessibilityShow & tell - Covert accessibility
Show & tell - Covert accessibility
 
Show & tell - All the small things
Show & tell - All the small thingsShow & tell - All the small things
Show & tell - All the small things
 
Show & tell - A more accessible accordion
Show & tell - A more accessible accordionShow & tell - A more accessible accordion
Show & tell - A more accessible accordion
 
Show & tell - 16 pixels of pain
Show & tell - 16 pixels of painShow & tell - 16 pixels of pain
Show & tell - 16 pixels of pain
 

Recently uploaded

存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
3a0sd7z3
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
Donato Onofri
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
wolfsoftcompanyco
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
Tarandeep Singh
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
3a0sd7z3
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
uehowe
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
k4ncd0z
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
uehowe
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
rtunex8r
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
uehowe
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
Toptal Tech
 

Recently uploaded (16)

存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
 

Show & tell - Flex in flux

  • 2. The Flexbox Layout CSS module aims to provide a more efficient way to lay out, align and distribute space among items in a container, even when their size is unknown and/or dynamic. - Chris Coyier
 Flexible box layout model W3C working draft, 23 July 2009 Revised in 2012 Sounds pretty neat, huh? What is flexbox?
  • 3. OMG! Flexbox is coming. RUN!
  • 4. Flexbox is awesome. So why aren’t we all using it all the time? Nobody puts flexi in the corner - It’s pretty complex - It’s fundamentally different (to how we’ve always done layout) - It’s not that well supported by browsers
  • 5. Firefox Full support 40+ Edge Full support Chrome Full support 43+ Android browser Full support 4.4+
 Pre-4.4 supports ‘old style’ Internet Explorer Full support 11+ Opera Full support Safari Full support 8+ iOS Safari Full support 9.1+
 Prefixed support from 8.4
  • 6. 1) Make a flexbox container The basics display: flex; 2) Add items inside the container <div> <aside> <section>
  • 8. flex-direction: row | row-reverse | column | column-reverse; row row-reverse column column-reverse The flexbox container
  • 9. #box-one #box-two #box-three #box-four #box-five The flexbox container flex-wrap: nowrap | wrap | wrap-reverse;
  • 11. By default flex items are displayed by source order. We can change this. #box-one #box-two #box-three Flexbox items order: x #box-one order: 2; #box-three order: 1; #box-two order: 66;
  • 12. Setting this to 1 (or more) allows the items to ‘grow’ to fit the container. flex-grow: <number> /* Default: 0 */ flex-grow: 1; flex-grow: 1; flex-grow: 1; flex-grow: 0; flex-grow: 0; flex-grow: 0; Flexbox items
  • 13. This allows an item to ‘shrink’ proportionally within the container if it needs to. flex-shrink: <number> /* Default: 1 */ flex-grow: 1; width: 35%; flex-grow: 1; width: 35%; flex-shrink: 1; Flexbox items
  • 14. This defines the default size of an element before the remaining space is distributed. It can be a length (e.g. 20%, 5rem, etc.) or a keyword. flex-basis: 50%; flex-basis: auto; flex-basis: x Flexbox items
  • 15. Float, clear, vertical-align have no effect on a flex item. There’s no combo, mix ’n’ match css here. You go 100% flexbox or you go home. Beware, beware !!!! !
  • 16. We can nest flex containers. This opens up the potential for some pretty insane layouts. How deep is your flex?
  • 17. within flex within flex within flex within flex within flex withi
  • 18. Foundation 6 has an optional grid system built with flexbox. The old grid system remains. However… The W3C strongly suggest that Flexbox should be used to layout individual web components and not full page layouts. We have the CSS grid layout for that. That’s another show & tell entirely. Are we there yet?
  • 19. Flexbox is finally ready for the big time. And we’re finally ready for flexbox.