SHARE
TWEET

Untitled

a guest Jun 18th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ## CSS
  2.  
  3. ```
  4. img, iframe {
  5.   aspect-ratio: attr(width) / attr(height);
  6. }
  7. ```
  8.  
  9. ## HTML
  10.  
  11. ```
  12. <img src="image.jpg" width="800" height="600" />
  13. ```
  14.  
  15. It automatically has the correct aspect ratio as the page loads. That's awesome.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top