😇Column Grid full example(Responsive)

https://www.quackit.com/html/templates/css_grid_templates.cfm

<!doctype html>
<title>Example</title>
<style>
.grid {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  grid-template-columns: repeat(12, 1fr);
  grid-gap: 10px;
}
.box {
  color: white;
  font-size: 4vw;
  padding: 10px;
  background: gold;
  text-align: center;
}
.box:nth-child(1) {
  grid-column: span 12;
  }
.box:nth-child(2), 
.box:nth-child(3) {
  grid-column: span 6;
  }
.box:nth-child(4),
.box:nth-child(5),
.box:nth-child(6) {
  grid-column: span 4;
  }
.box:nth-child(7),
.box:nth-child(8),
.box:nth-child(9),
.box:nth-child(10) {
  grid-column: span 3;
  }
.box:nth-child(11),
.box:nth-child(12),
.box:nth-child(13),
.box:nth-child(14),
.box:nth-child(15),
.box:nth-child(16) {
  grid-column: span 2;
  }
@media screen and (max-width: 575px) {
    .grid {
      display: block;
      }
    .box {
      margin: 10px 0;
    }
  }
</style>
<main class="grid">
  <div class="box">1</div>
  <div class="box">2</div>
  <div class="box">3</div>
  <div class="box">4</div>
  <div class="box">5</div>
  <div class="box">6</div>
  <div class="box">7</div>
  <div class="box">8</div>
  <div class="box">9</div>
  <div class="box">10</div>
  <div class="box">11</div>
  <div class="box">12</div>
  <div class="box">13</div>
  <div class="box">14</div>
  <div class="box">15</div>
  <div class="box">16</div>
  <div class="box">17</div>
  <div class="box">18</div>
  <div class="box">19</div>
  <div class="box">20</div>
  <div class="box">21</div>
  <div class="box">22</div>
  <div class="box">23</div>
  <div class="box">24</div>
  <div class="box">25</div>
  <div class="box">26</div>
  <div class="box">27</div>
  <div class="box">28</div>
</main>

12 Column Grid (Mobile First)

12 Column Grid Example 2 (Responsive)

12 Column Grid Example 2 (Mobile First)

12 Column Vertical Grid (Responsive)

12 Column Vertical Grid (Mobile First)

Grid Layout 1

Grid Layout 2

Grid Layout 3

Grid Layout 4

Grid Layout 5

Grid Layout 6

Grid Layout 7

Grid Layout 8

Grid Layout 9

Grid Layout 10

Grid Layout 11

Grid Layout 12

Form with Auto Placement

Nested Grid

Repeating Grid

Repeating Grid with Span

Last updated

Was this helpful?