SlideShare a Scribd company logo
1 of 63
Descomplicando o
alinhamento
com CSS
Fernanda Bernardo
fernanda.bernardo@elo7.com
FernandaBernard
o
@Feh_Bernardo
Fernanda Bernardo
CSS
Wee
Flexbox
Float Position
Vertical Align
Transform
CSS Grid
Layout
Display
Flexbox
CSS Grid
Layout
Float
Vertical Align
Display
Transform
Position
Grid LayoutFlexbox
https://youtu.be/vPryjyFP5FM
Suporte
Flexbox
CSS Grid Layout
Chrome Safari Firefox Opera IE Android IOS
21+ 6.1+ 22+ 12.1+ 11+ 4.4+ 7.1+
DESKTOP
Chrome Opera Firefox IE Edge Safari
57+ 44+ 52+ 11+ 15+ 10.1+
MOBILE / TABLET
IOS Safari Opera Mobile Opera Mini Android Android Chrome Android Firefox
10.3 No No No 57+ 52+
Flexbox
display
flex-direction
flex-direction
flex-wrap
flex-wrap
flex-start
justify-content:
flex-start
flex-end
justify-content:
flex-start
flex-end
center
justify-content:
flex-start
flex-end
center
space-between
justify-content:
flex-start
flex-end
center
space-between
space-around
justify-content:
align-content
justify-content ???
HORIZONTAL
VERTICAL
align-content
align-items
flex-start
align-items
flex-end
flex-start
align-items
center
flex-end
flex-start
order
order
order
align-self center
flex-end
align-self center
flex-end
Grid Layout
display
display
display
grid-template
grid-template
150px 150pxauto
grid-template
grid-template
100px
100px
grid-template
100px
100px
Uma fração do espaço disponível no container do grid
fr unit
grid-template
1fr 1fr 1fr 1fr
grid-template
grid-row / grid-column
col1 col2 col3 col4 col5 col6
row3
row2
row1
grid-row / grid-column
grid-row / grid-column
grid-row / grid-column
grid-row / grid-column
1 2 3 4
grid-area
grid-areas
grid-gap
Conclusões
CSS Grid - layouts maiores
Flexbox - layouts menores
CSS Grid - 2 dimensões
Flexbox - 1 dimensão
Não é preciso
escolher entre
um ou outro.
É possível usar os
dois em conjunto.
Bibliografia
● https://developer.mozilla.org/pt-BR/docs/Web/CSS/CSS_Grid_Layout
● https://developers.google.com/web/updates/2017/01/css-grid
● https://gridbyexample.com
● http://labs.jensimmons.com/
● http://cssgridgarden.com/
● https://flexboxfroggy.com/
fernanda.bernardo@elo7.com
FernandaBernardo
@Feh_Bernardo

More Related Content

Similar to Descomplicando o alinhamento com css

Similar to Descomplicando o alinhamento com css (7)

Layout with flexbox
Layout with flexboxLayout with flexbox
Layout with flexbox
 
Java or Forms, why not both?
Java or Forms, why not both?Java or Forms, why not both?
Java or Forms, why not both?
 
Mobile development with Flex 4.5 - LiveData May
Mobile development with Flex 4.5 - LiveData MayMobile development with Flex 4.5 - LiveData May
Mobile development with Flex 4.5 - LiveData May
 
Flexbox Will Shock You!
Flexbox Will Shock You!Flexbox Will Shock You!
Flexbox Will Shock You!
 
Ridiculously Easy Layouts with Flexbox
Ridiculously Easy Layouts with FlexboxRidiculously Easy Layouts with Flexbox
Ridiculously Easy Layouts with Flexbox
 
Dojo & HTML5
Dojo & HTML5Dojo & HTML5
Dojo & HTML5
 
Is Flexbox the Future of Layout?
Is Flexbox the Future of Layout?Is Flexbox the Future of Layout?
Is Flexbox the Future of Layout?
 

More from Fernanda Bernardo

Diabetes Mais Doce - Versão 1.0
Diabetes Mais Doce - Versão 1.0Diabetes Mais Doce - Versão 1.0
Diabetes Mais Doce - Versão 1.0
Fernanda Bernardo
 

More from Fernanda Bernardo (19)

Reinventar a roda a cada novo framework js, vale a pena?
Reinventar a roda a cada novo framework js, vale a pena?Reinventar a roda a cada novo framework js, vale a pena?
Reinventar a roda a cada novo framework js, vale a pena?
 
Jogos 3.0 - MVP Conf
Jogos 3.0 - MVP ConfJogos 3.0 - MVP Conf
Jogos 3.0 - MVP Conf
 
Jogos 3.0
Jogos 3.0Jogos 3.0
Jogos 3.0
 
Palestrantes são seres super mágicos?
Palestrantes são seres super mágicos?Palestrantes são seres super mágicos?
Palestrantes são seres super mágicos?
 
Jogos: indo além do simples CSS 3.0
Jogos: indo além do simples CSS 3.0Jogos: indo além do simples CSS 3.0
Jogos: indo além do simples CSS 3.0
 
Ecmascript - Versão extendida
Ecmascript - Versão extendidaEcmascript - Versão extendida
Ecmascript - Versão extendida
 
EcmaScript
EcmaScriptEcmaScript
EcmaScript
 
Ux para aumentar a liberdade dos diabéticos
Ux para aumentar a liberdade dos diabéticosUx para aumentar a liberdade dos diabéticos
Ux para aumentar a liberdade dos diabéticos
 
Jogos com css 2.0
Jogos com css 2.0Jogos com css 2.0
Jogos com css 2.0
 
Jogos com css
Jogos com cssJogos com css
Jogos com css
 
Isomorfismo pra quê?
Isomorfismo pra quê?Isomorfismo pra quê?
Isomorfismo pra quê?
 
A influência dos usuários no desenvolvimento do Talk7
A influência dos usuários no desenvolvimento do Talk7A influência dos usuários no desenvolvimento do Talk7
A influência dos usuários no desenvolvimento do Talk7
 
Front end ++: seo e flexbox
Front end ++: seo e flexboxFront end ++: seo e flexbox
Front end ++: seo e flexbox
 
Workshop android
Workshop androidWorkshop android
Workshop android
 
Transformando barreiras para ajudar comunidades
Transformando barreiras para ajudar comunidadesTransformando barreiras para ajudar comunidades
Transformando barreiras para ajudar comunidades
 
Heroku
HerokuHeroku
Heroku
 
UX para aumentar a liberdade de diabéticos
UX para aumentar a liberdade de diabéticosUX para aumentar a liberdade de diabéticos
UX para aumentar a liberdade de diabéticos
 
Diabetes Mais Doce - Versão 1.0
Diabetes Mais Doce - Versão 1.0Diabetes Mais Doce - Versão 1.0
Diabetes Mais Doce - Versão 1.0
 
Coding Dojo
Coding DojoCoding Dojo
Coding Dojo
 

Recently uploaded

Recently uploaded (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
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...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Descomplicando o alinhamento com css