Answers for "css resize image to fit div no stretching"

CSS
2

css resize image to fit div no stretching

.div {
  background-image: url(../images/your-image.png);
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
}
Posted by: Guest on October-06-2020
0

How to make an image fill its container without stretching

.cover {
  object-fit: cover;
  width: 50px;
  height: 100px;
}
Posted by: Guest on May-12-2021

Code answers related to "css resize image to fit div no stretching"

Browse Popular Code Answers by Language