SlideShare uma empresa Scribd logo
1 de 54
Baixar para ler offline
Kim Grinfeder
http://www.servergrove.com http://interactive.miami.edu
@kimgrinfeder
Flex Layouts
Tuesday, April 22, 14
CSS
IS
AWESOME
Tuesday, April 22, 14
Flexbox
A CSS box model optimized for user interface
design
Tuesday, April 22, 14
WARNING:This specification has gone through multiple
revisions. Check the expiration date on tutorials.
Tuesday, April 22, 14
Can I use it?
Tuesday, April 22, 14
display: block;
Layout options
Tuesday, April 22, 14
display: inline;
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut suscipit
erat sodales venenatis consequat. Nunc vel eleifend ipsum, in
tempor metus. Suspendisse quis mi sed lacus dictum dignissim a
eget mi. Vestibulum quis quam placerat, lobortis risus laoreet,
fringilla erat. Sed volutpat tristique cursus. Integer dapibus felis
augue, ut rutrum lectus iaculis sed. Mauris lobortis egestas ipsum, at
sodales nibh. Nunc mi felis, blandit at tempus quis, commodo a
purus. Duis dictum, tortor vitae commodo posuere, sapien dui
scelerisque nunc, nec accumsan lorem elit eu magna. Nullam in
condimentum nunc.
Layout options
Tuesday, April 22, 14
Layout options
display: inline-block;
Tuesday, April 22, 14
floats
clears
clearfix
box-sizing
...
Tuesday, April 22, 14
Layout options
display: flex;
Tuesday, April 22, 14
Flex Container
flex item
flex container
flex item
flex item
display: flex;
Tuesday, April 22, 14
<div class=”flex”>
...
</div>
<style>
display: flex;
</style>
Tuesday, April 22, 14
Flex Container
flex item
flex container
flex item
flex item
display: flex;
Tuesday, April 22, 14
Flex Container
flex container cross axis
main axis
display: flex;
Tuesday, April 22, 14
Children of a flex
container can be laid out in any direction
Tuesday, April 22, 14
Flex Container
flex item
flex item
flex item
display: flex;
Tuesday, April 22, 14
Flex Container
flex item
flex item
flex item
display: flex;
Tuesday, April 22, 14
Flex Container
flex item flex item flex item
display: flex;
Tuesday, April 22, 14
Flex Container
flex item flex item flex item
display: flex;
Tuesday, April 22, 14
Flex Container
flex item flex item flex item
display: flex;
Tuesday, April 22, 14
Main Axis
justify-content: flex-start
Tuesday, April 22, 14
Main Axis
justify-content: flex-end
Tuesday, April 22, 14
Main Axis
justify-content: center
Tuesday, April 22, 14
Main Axis
justify-content: space-between
Tuesday, April 22, 14
Main Axis
justify-content: space-around
Tuesday, April 22, 14
Cross Axis
align-items: flex-start
Tuesday, April 22, 14
Cross Axis
align-items: flex-end
Tuesday, April 22, 14
Cross Axis
align-items: center
Tuesday, April 22, 14
Cross Axis
align-items: stretch
Tuesday, April 22, 14
Cross Axis
align-items: baseline
I Love Miami
Tuesday, April 22, 14
flex-direction: row;
1 2 3
Tuesday, April 22, 14
flex-direction: row-reverse;
3 2 1
Tuesday, April 22, 14
flex-direction: row;
cross-axis
main-axis
Tuesday, April 22, 14
flex-direction: column;
Tuesday, April 22, 14
flex-direction: column;
Tuesday, April 22, 14
cross-axis
flex-direction: column;
main-axis
Tuesday, April 22, 14
cross-axis
main-axis
flex-direction: column;
1
2
3
Tuesday, April 22, 14
cross-axis
main-axis
flex-direction: column-reverse;
1
2
3
Tuesday, April 22, 14
Flex Container
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
Tuesday, April 22, 14
flex-wrap
flex-wrap: nowrap
Tuesday, April 22, 14
flex-wrap
flex-wrap: wrap
1 2 3 4 5 6 7
8 9 10 11 12 13 14
Tuesday, April 22, 14
flex-wrap
flex-wrap: wrap-reverse
8 9 10 11 12 13 17
1 2 3 4 5 6 7
Tuesday, April 22, 14
flex-wrap
flex-wrap: nowrap
Tuesday, April 22, 14
flex-flow
flex-wrap + flex-direction
flex-flow: row wrap;
Tuesday, April 22, 14
Flex-items
Tuesday, April 22, 14
flex-grow
Determines how much the flex item will grow relative to
the rest of the flex items in the flex container when
positive free space is distributed
Tuesday, April 22, 14
flex-shrink
Determines how much the flex item will shrink relative to
the rest of the flex items in the flex container when
negative free space is distributed
Tuesday, April 22, 14
flex-basis
The initial main size of a flex item,
before free space is distributed according to the flex factors
The default value is auto,
also accepts % or absolute length
Tuesday, April 22, 14
flex-basis
Tuesday, April 22, 14
flex
flex: 1 1 200px;
=
flex-grow: 1;
flex-shrink: 1;
flex-basis: 200px;
Tuesday, April 22, 14
order
Controls the order in which flex items appear
within their flex container
Tuesday, April 22, 14
align-self
Overrides the default alignment (align-items)
for individual flex-items.
Tuesday, April 22, 14
Responsive?
Tuesday, April 22, 14
Thank you
kimgrinfeder@gmail.com
@kimgrinfeder
Tuesday, April 22, 14

Mais conteúdo relacionado

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

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?
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.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...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Destaque

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Flexbox presentation front end developers meetup miami