Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

css image fit in div with aspect ratio

img {
    width: 100%;
    height: 100%; 
    object-fit: contain;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #css #image #fit #div #aspect #ratio
ADD COMMENT
Topic
Name
7+9 =