Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

preserve aspect ratio image css

/* Simply add width without height,
aspect ratio will be maintained 
and height will be calculated accordingly*/

img {
  width: 100px;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #preserve #aspect #ratio #image #css
ADD COMMENT
Topic
Name
3+7 =