<div class="container">

        <div>
            <img src="https://images.unsplash.com/photo-1558981033-0f0309284409?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="bike">
        </div>

        <div>
            <img src="https://images.unsplash.com/photo-1580820726687-30e7ba70d976?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="rose">
        </div>

        <div>
            <img src="https://images.unsplash.com/photo-1580769154185-abdda4691da5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="camera">
        </div>

        <div>
            <img src="https://images.unsplash.com/photo-1580732055671-e64dde2eb75b?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="road">
        </div>

        <div>
            <img src="https://images.unsplash.com/photo-1580785422463-c88da52a2922?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="night-1927265_960_720">
        </div>

        <div>
            <img src="https://images.unsplash.com/photo-1558666831-d43129d768b2?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="sunset">
        </div>

        <div>
            <img src="https://images.unsplash.com/photo-1580793660347-5cc5e9d2c6dd?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="model">
        </div>

        <div>
            <img src="https://images.unsplash.com/photo-1580761072152-9d6b9c77cf4f?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="bird">
        </div>

        <div>
            <img src="https://images.unsplash.com/photo-1580794592903-65ebe8345cd3?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="car">
        </div>

        <div>
            <img src="https://images.unsplash.com/photo-1580793660347-5cc5e9d2c6dd?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="portrait-3013924_960_720">
        </div>

        <div>
            <img src="https://images.unsplash.com/photo-1580802173430-cc68226a0875?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="portrait-3013924_960_720">
        </div>

        <div>
                        <img src="https://images.unsplash.com/photo-1580820726687-30e7ba70d976?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="rose">
        </div>

    </div>
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  padding: 2rem;
}
ul {
  padding: 1rem;
  display: flex;
  list-style: none;
  justify-content: space-around;
  flex-wrap: wrap;
}
li {
  background-color: #ffdfd9;
  color: #000;
  padding: 0.51rem;
}
.container {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 290px));
  grid-gap: 1rem;
  padding: 1rem;
  justify-content: center;
  box-shadow: 0 1px 1px #000;
}
img {
  background-position: top;
  background-size: cover;
  height: 200px;
  width: 290px;
  box-shadow: 0 2px 10px #000;
  cursor: pointer;
  transition: all 0.2s;
}
img:hover {
  box-shadow: none;
  transform: scale(1.1);
}


Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.