Daily Software Tips & Tricks
Bite-sized knowledge to improve your coding skills daily.
Say Goodbye to Padding Hacks
March 26, 2026
For years, developers used the "padding-bottom" trick to maintain aspect ratios for images and video containers, but those days are finally over. The modern "aspect-ratio" CSS property is now supported in all major browsers. Just set "aspect-ratio: 16 / 9;" on an element, and it will maintain that shape regardless of the width. It makes your layouts much cleaner and easier to reason about without the need for extra wrapper divs.