<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
</head>
<style>
.wrapper {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
grid-gap: 10px;
width: 100%;
background: #fff;
}
.box {
background: #f60;
height:60px;
}
img{width:auto;}
</style>
<body>
<div class="wrapper">
<div class="box b1">1</div>
<div class="box b2">2</div>
<div class="box b3">3 </div>
<div class="box b3">4</div>
<div class="box b3">5</div>
<div class="box b3">6</div>
<div class="box b3">7</div>
<div class="box b3">8</div>
</div>
</body>
</html>