A Practical Guide to Aspect Ratio in CSS
A practical, hands-on guide to using aspect ratio in CSS.
With CSS aspect-ratio property, supported in all modern browsers, you will no longer need to resort to padding hack to maintain the proportional dimensions of an element.
Chapters
- 00:00 Intro
- 00:22 How aspect-ratio property works
- 01:57 How padding hack works
- 03:04 An example with the aspect-ratio property
- 04:01 Using "auto" value with aspect-ratio property
- 05:53 Setting aspect ratio on an iframe
- 07:34 What exactly preferred aspect ratio means
- 08:21 How aspect-radio media query works
- 09:44 Conclusion



