Вы можете упростить вашу сетку, как показано ниже, без необходимости использования областей сетки:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
list-style: none;
text-decoration: none;
}
.container {
width: 80%;
margin: 0 auto;
}
.grid {
padding: 50px 0;
display: grid;
grid-template-columns:1fr 1fr 1fr;
grid-gap: 15px;
}
.box_a {
background: gray;
padding: 20px 40px;
}
.box_b {
background: black;
color: white;
padding: 20px 40px;
}
.box_c {
padding: 20px 40px;
background: lightblue;
}
.b2,.b5 {
grid-column:2/span 2;
}
.b3 {
grid-column:1/span 3;
}
<section class="main">
<div class="container grid">
<div class="box_a b1">
<h2>What we do</h2>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Adipisci, commodi.</p>
<a href="#">Povezava nekam</a>
</div>
<div class="box_b b2">
<h2>How we do it</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. In quibusdam iste, earum aut facilis nobis?</p>
<a href="#">Povezava nekam</a>
</div>
<div class="box_c b3">
<div class="post_top">
<a href="#">Povezava prispevka</a>
<h2>Nek zelo dolg naslov prispevka da bo zgledalo lepo</h2>
</div>
<div class="post_bottom">
<h2>Nek podnaslov</h2>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quisquam, placeat. Maiores omnis numquam error adipisci.</p>
</div>
</div>
<div class="box_a b4">
<a href="#">Povezava nekam</a>
<h2>Lorem Ipsum</h2>
<a href="#">Preberi več</a>
</div>
<div class="box_b b5">
<a href="#">Povezava nekam</a>
<h2>Nek srednje dolg naslov</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ut, neque.</p>
</div>
</div>
</section>
Соответствующий код:
.grid {
...
grid-template-columns:1fr 1fr 1fr; /*define 3 columns*/
..
}
.b2,.b5 {
grid-column:2/span 2; /*take 2 colmuns starting from 2*/
}
.b3 {
grid-column:1/span 3; /*take 3 columns starting from 1*/
}