HTML&CSS - background-image size cover

by Code_Garage

HTML

<div class="container" id="example">Lorem ipsum dolores sit amet appenditur salvia jacta est.</div>

CSS

body {
  min-height: 600px;
}
.container {
  font-family: arial;
  font-weight: bold;
  width: 200px;
  height: 200px;
  margin: 5px;
  padding: 5px;
  color: white;
  box-sizing: border-box;
}

#example {
  background-image: url(https://picsum.photos/seed/3/400/200);
  background-repeat: no-repeat;
  background-size: cover;
}