Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## CSS
- ```
- img, iframe {
- aspect-ratio: attr(width) / attr(height);
- }
- ```
- ## HTML
- ```
- <img src="image.jpg" width="800" height="600" />
- ```
- It automatically has the correct aspect ratio as the page loads. That's awesome.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement