Answers for "how to get an image to fill its container css"

1

image to fill div

.fill {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden
}
.fill img {
    flex-shrink: 0;
    min-width: 100%;
    min-height: 100%
}
Posted by: Guest on March-21-2021
0

fill image in div

img {
  width: 200px;
  height: 
  300px;
  object-fit: cover;
}
Posted by: Guest on August-23-2021

Code answers related to "how to get an image to fill its container css"

Browse Popular Code Answers by Language