Answers for "how to cover the div with image n css"

CSS
1

how to contain an image within a div

.cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    overflow: hidden;
}
Posted by: Guest on December-21-2021
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

Browse Popular Code Answers by Language