Aspect Ratio Boxes in CSS


Maintain aspect ratios for content containers using padding tricks or the new aspect-ratio property.

Source Code

.aspect-ratio-box {
    aspect-ratio: 16 / 9;
    background-color: #f0f0f0;
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments