Answers for "how to make image fit the div while keeping aspect ratio"

CSS
9

css image fit in div with aspect ratio

img {
    width: 100%;
    height: 100%; 
    object-fit: contain;
}
Posted by: Guest on July-02-2020

Code answers related to "how to make image fit the div while keeping aspect ratio"

Browse Popular Code Answers by Language