Aspect-ratio property in CSS ✨

preview_player
Показать описание
The new aspect-ratio property in CSS ✨

For a long time, making an element follow an aspect ratio was a tedious process. You have to use the padding and absolute position trick.

Recently the aspect-ratio property was introduced to simplify this.

👉 By specifying an aspect ratio, if one of the dimension (width or height) is provided explicitly or implicitly, the other dimension will be automatically calculated

👉 This is perfect for when you want to have square elements or video frames

#css #csstricks #coding #programming #frontend #fullstack #html #javascript #webdevelopment
Рекомендации по теме
Комментарии
Автор

but for images this property is applied by default right?

ankitbhagat