<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>grid</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-width: 100vw;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.container {
display: grid;
min-width: 1000px;
gap: 5px;
}
.container > .row {
display: grid;
grid-template-columns: repeat(12, 1fr);
gap: 5px;
min-height: 50px;
}
.container > .row > .item {
background-color: lightgreen;
padding: 10px;
}
.container > .row > .col-12 {
grid-column: span 12;
}
.container > .row > .col-11 {
grid-column: span 11;
}
.container > .row > .col-10 {
grid-column: span 10;
}
.container > .row > .col-9 {
grid-column: span 9;
}
.container > .row > .col-8 {
grid-column: span 8;
}
.container > .row > .col-7 {
grid-column: span 7;
}
.container > .row > .col-6 {
grid-column: span 6;
}
.container > .row > .col-5 {
grid-column: span 5;
}
.container > .row > .col-4 {
grid-column: span 4;
}
.container > .row > .col-3 {
grid-column: span 3;
}
.container > .row > .col-2 {
grid-column: span 2;
}
.container > .row > .col-1 {
grid-column: span 1;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="item col-12">12列</div>
</div>
<div class="row">
<div class="item col-1">1列</div>
<div class="item col-1">1列</div>
<div class="item col-1">1列</div>
<div class="item col-1">1列</div>
<div class="item col-1">1列</div>
<div class="item col-1">1列</div>
<div class="item col-1">1列</div>
<div class="item col-1">1列</div>
<div class="item col-1">1列</div>
<div class="item col-1">1列</div>
<div class="item col-1">1列</div>
<div class="item col-1">1列</div>
</div>
<div class="row">
<div class="item col-6">6列</div>
<div class="item col-6">6列</div>
</div>
<div class="row">
<div class="item col-4">4列</div>
<div class="item col-4">4列</div>
<div class="item col-4">4列</div>
</div>
<div class="row">
<div class="item col-3">3列</div>
<div class="item col-3">3列</div>
<div class="item col-3">3列</div>
<div class="item col-3">3列</div>
</div>
<div class="row">
<div class="item col-2">2列</div>
<div class="item col-2">2列</div>
<div class="item col-2">2列</div>
<div class="item col-2">2列</div>
<div class="item col-2">2列</div>
<div class="item col-2">2列</div>
</div>
<div class="row">
<div class="item col-10">10列</div>
<div class="item col-2">2列</div>
</div>
</div>
</body>
</html>