<ul>
        <li> <img src="//unsplash.it/500/300" alt=""></li>
        <li> <img src="//unsplash.it/300/500" alt="">
        </li>
        <li> <img src="//unsplash.it/400/300" alt="">
        </li>
        <li> <img src="//unsplash.it/400/400" alt=""></li>
        <li> <img src="//unsplash.it/300/400" alt="">
        </li>
        <li> <img src="//unsplash.it/400/600" alt=""></li>
        <li> <img src="//unsplash.it/400/300" alt=""></li>
        <li> <img src="//unsplash.it/600/400" alt="">

    </ul>
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

ul {
    display: flex;
    flex-wrap: wrap;
}

li {
    height: 40vh;
    flex-grow: 1;
    list-style: none;
    padding: 12px;
    /*     overflow: hidden; */
}

img {
    max-height: 100%;
    min-width: 100%;
    object-fit: cover;
    vertical-align: bottom;
    box-shadow: 5px 5px 5px transparent;
    transition: all 0.5s;
    border: solid 2px rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    box-shadow: 0 2px 5px 0px rgba(0, 0, 0, 0.767);
}

img:hover {
    filter: blur(0px);
    opacity: 1;
    box-shadow: 0 8px 20px 0px rgba(0, 0, 0, 0.767);
    transform: scale(1.02);
    transition: all 0.5s;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.