Keeping aspect-ratio With HTML and No Padding Tricks

Noam Rosenthal / filed under HTML & CSS

For a long time we’ve been told the only way to have a DOM element keep a fixed aspect ratio without Javascript is with the % padding trick.

Subscribe to newsletter

Design and frontend links delivered to your inbox every day and week. No spam, unsubscribe at anytime.

Choose frequency

Permission