For example:
Code:
<!DOCTYPE html>
<html>
<style>
.container {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
}
@media screen and (max-width: 1200px) {
.container {
grid-template-columns: 1fr 1fr;
}
}
@media screen and (max-width: 600px) {
.container {
grid-template-columns: 1fr;
}
}
</style>
<body>
<!-- Header -->
<div class="header">
<h1>Camera Snapshot Grid</h1>
</div>
<!-- Photo Grid -->
<div class="container">
<div style="width:100%; background:red"> </div>
<div style="width:100%; background:blue"> </div>
<div style="width:100%; background:green"> </div>
<div style="width:100%; background:red"> </div>
<div style="width:100%; background:blue"> </div>
<div style="width:100%; background:green"> </div>
<div style="width:100%; background:red"> </div>
<div style="width:100%; background:blue"> </div>
<div style="width:100%; background:green"> </div>
</div>
</body>
</html>
This will show a grid with four columns if wide enough, otherwise two, otherwise one.