image cover css

CSS
body {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}object-fit: cover;body {
  margin: 0;
}
img {
  display: block;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
}
Source

Also in CSS: