SlideShare a Scribd company logo
New CSS ways to
control layout
 RTL/LTR Logical Properties
 Media Queries - Best Practices
By Lior Zamir, CET
Tech Talk
Bi-directional Websites
No More Mixins!
Until recently, the best way to support multiple direction websites
like RTL/LTR Websites was with SASS/LESS mixins.
The new Box Model
Logical Properties - Best Practices
• Stop thinking in terms of left/right or top/bottom
• Replace them with inline-start/inline-end and block-
start/block-end.
Logical Property Physical Property
inline-start / inline-end left / right
block-start / block-end top / bottom
Physical Properties vs Logical Properties
Logical Property
Physical Property
Left To Right (LTR) Right To Left (RTL)
margin-inline-start margin-left margin-right
margin-inline-end margin-right margin-left
padding-inline-start padding-left padding-right
padding-inline-end padding-right padding-left
border-inline-start{-size|style|color} border-left{-size|style|color} border-right{-size|style|color}
border-inline-end{-size|style|color} border-right{-size|style|color} border-left{-size|style|color}
Physical Properties vs Logical Properties
Logical Property
Physical Property
Left To Right (LTR) Right To Left (RTL)
inset-inline-start left right
inset-inline-end right left
text-align: start text-align: left text-align: right
text-align: end text-align: right text-align: left
New CSS ways to control layout
Demo and References
• Demo: https://codepen.io/tutsplus/pen/gywJJK
• CSS Logical Properties and Values -
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties
Using Media Queries
for Responsive Design
in 2020
Do we need a Media Query at all?
• Flexbox and Grid Layout, along with Multi-column layout
are responsive by default.
• Responsive by default layout methods (3 examples: Multicol, Flexbox, Grid) –
https://codepen.io/lior-zamir/pen/poyqzRV
Media-queries and Grid work incredibly
well together…
Demo: Media Queries and Grid Layout
Media Queries Best Practices
• Don’t target devices, add breakpoints when the design breaks.
• When creating your breakpoints, consider moving away from pixels.
Use the em unit instead.
[ ref 1 - “…the only unit that performed consistently across all 4 browsers
is em…” ]
[ ref 2 - “…it’s best to be safe and use em breakpoints in your media queries…” ]
• Media Queries Level 4:
Detecting pointer type rather than screen size.
Media
Queries
Level 4:
interaction
media
features
@media pointer
@media hover
https://mediaQueriesTest.com
References
• Media Queries Level 4 - W3C Candidate Recommendation -
https://www.w3.org/TR/mediaqueries-4
New CSS ways to control layout

More Related Content

PPTX
Cruising in data lake from zero to scale
PPTX
Glenn Cedströmer Innholdsseminar Nasjonal Booking
PDF
UTOUG Training Days 2019 Voyage to Visual Builder Cloud Service
PDF
Responsive Web design Zambig
PPTX
Week 8 - Interactive News Editing and Producing
PDF
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
PPTX
Content authoring for responsive design
Cruising in data lake from zero to scale
Glenn Cedströmer Innholdsseminar Nasjonal Booking
UTOUG Training Days 2019 Voyage to Visual Builder Cloud Service
Responsive Web design Zambig
Week 8 - Interactive News Editing and Producing
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
Content authoring for responsive design

Similar to New CSS ways to control layout (20)

PDF
Web design for right-to-left languages
PPTX
Lecture-8.pptx
PDF
CSS vs. JavaScript - Trust vs. Control
PPTX
Media queries and frameworks
PDF
Responsive webdesign WordCampNL 2012
PPTX
Advanced CSS.pptx
PPTX
Rwd ppt
PPTX
responsive web design 1_oct_2013
PPTX
responsive web design
PPTX
Responsive Web design _2013
PDF
Responsive Web Design, the secret sauce - MSDEVMTL - 2016-01-25
PPTX
Web technologies-course 04.pptx
PPTX
Web Programming
PPTX
Responsive Web Design - Breaking Points
PDF
CSS3 Media Queries
PPTX
Responsive web design
PDF
Full download Responsive Web Design with HTML5 and CSS3 Second Edition Ben Fr...
PDF
CSS3, Media Queries, and Responsive Design
PPTX
Responsive UI using CSS Media Query
PDF
The Future of CSS Layout
Web design for right-to-left languages
Lecture-8.pptx
CSS vs. JavaScript - Trust vs. Control
Media queries and frameworks
Responsive webdesign WordCampNL 2012
Advanced CSS.pptx
Rwd ppt
responsive web design 1_oct_2013
responsive web design
Responsive Web design _2013
Responsive Web Design, the secret sauce - MSDEVMTL - 2016-01-25
Web technologies-course 04.pptx
Web Programming
Responsive Web Design - Breaking Points
CSS3 Media Queries
Responsive web design
Full download Responsive Web Design with HTML5 and CSS3 Second Edition Ben Fr...
CSS3, Media Queries, and Responsive Design
Responsive UI using CSS Media Query
The Future of CSS Layout
Ad

More from Lior Zamir (14)

PPTX
SharePoint Online (365) vs SharePoint On-Premises
PPTX
HTML5 Local Storage
PPTX
שילוב אלמנטים גרפיים באתר אינטרנט
PPTX
Office 2010 IT
PPTX
PPTX
Office2007 full with_products
PPTX
Ado.Net - שיטות לעבודה עם בסיס נתונים בסביבת
PPTX
Internet introduction
PPTX
Web Technologies
PPTX
Web 2.0
PPTX
Microsoft .Net Framework
PPT
Computer Communication
PPTX
Search Engines
PPT
Web Services
SharePoint Online (365) vs SharePoint On-Premises
HTML5 Local Storage
שילוב אלמנטים גרפיים באתר אינטרנט
Office 2010 IT
Office2007 full with_products
Ado.Net - שיטות לעבודה עם בסיס נתונים בסביבת
Internet introduction
Web Technologies
Web 2.0
Microsoft .Net Framework
Computer Communication
Search Engines
Web Services
Ad

Recently uploaded (20)

PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Modernizing your data center with Dell and AMD
PPTX
A Presentation on Artificial Intelligence
PPTX
Cloud computing and distributed systems.
PPT
Teaching material agriculture food technology
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Diabetes mellitus diagnosis method based random forest with bat algorithm
Advanced methodologies resolving dimensionality complications for autism neur...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Machine learning based COVID-19 study performance prediction
Per capita expenditure prediction using model stacking based on satellite ima...
Building Integrated photovoltaic BIPV_UPV.pdf
Modernizing your data center with Dell and AMD
A Presentation on Artificial Intelligence
Cloud computing and distributed systems.
Teaching material agriculture food technology
Spectral efficient network and resource selection model in 5G networks
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Encapsulation_ Review paper, used for researhc scholars
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Electronic commerce courselecture one. Pdf
cuic standard and advanced reporting.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

New CSS ways to control layout

  • 1. New CSS ways to control layout  RTL/LTR Logical Properties  Media Queries - Best Practices By Lior Zamir, CET Tech Talk
  • 3. No More Mixins! Until recently, the best way to support multiple direction websites like RTL/LTR Websites was with SASS/LESS mixins.
  • 4. The new Box Model
  • 5. Logical Properties - Best Practices • Stop thinking in terms of left/right or top/bottom • Replace them with inline-start/inline-end and block- start/block-end. Logical Property Physical Property inline-start / inline-end left / right block-start / block-end top / bottom
  • 6. Physical Properties vs Logical Properties Logical Property Physical Property Left To Right (LTR) Right To Left (RTL) margin-inline-start margin-left margin-right margin-inline-end margin-right margin-left padding-inline-start padding-left padding-right padding-inline-end padding-right padding-left border-inline-start{-size|style|color} border-left{-size|style|color} border-right{-size|style|color} border-inline-end{-size|style|color} border-right{-size|style|color} border-left{-size|style|color}
  • 7. Physical Properties vs Logical Properties Logical Property Physical Property Left To Right (LTR) Right To Left (RTL) inset-inline-start left right inset-inline-end right left text-align: start text-align: left text-align: right text-align: end text-align: right text-align: left
  • 9. Demo and References • Demo: https://codepen.io/tutsplus/pen/gywJJK • CSS Logical Properties and Values - https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties
  • 10. Using Media Queries for Responsive Design in 2020
  • 11. Do we need a Media Query at all? • Flexbox and Grid Layout, along with Multi-column layout are responsive by default. • Responsive by default layout methods (3 examples: Multicol, Flexbox, Grid) – https://codepen.io/lior-zamir/pen/poyqzRV
  • 12. Media-queries and Grid work incredibly well together… Demo: Media Queries and Grid Layout
  • 13. Media Queries Best Practices • Don’t target devices, add breakpoints when the design breaks. • When creating your breakpoints, consider moving away from pixels. Use the em unit instead. [ ref 1 - “…the only unit that performed consistently across all 4 browsers is em…” ] [ ref 2 - “…it’s best to be safe and use em breakpoints in your media queries…” ] • Media Queries Level 4: Detecting pointer type rather than screen size.
  • 18. References • Media Queries Level 4 - W3C Candidate Recommendation - https://www.w3.org/TR/mediaqueries-4

Editor's Notes

  • #12: These specifications were written in a world where responsive design and supporting multiple devices was already a thing.