css resize image to fit div no stretching

63

.cover {
  object-fit: cover;
  width: 50px;
  height: 100px;
}
.div {
  background-image: url(../images/your-image.png);
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
}

Comments

Submit
0 Comments