As I now have the code with grid-column-gap: 3%;
, I have a separation between each column of 3% and that's fine, but I want between block 2 and block 3 there's only 1% separation.
I've tried putting grid-column-gap: 3% 1% 3%;
but it does not work. Any ideas?
.contenedor {
margin: 30px;
display: grid;
grid-column-gap: 3%;
grid-row-gap: 5%;
grid-template-columns: 30% repeat(2, 10%) 30%;
grid-template-rows: 100px;
}
.bloque {
padding: 2%;
background-color: blue;
color: white;
line-height: 100px;
text-align: center;
}
<div class="contenedor">
<div class="bloque">Bloque 1</div>
<div class="bloque">Bloque 2</div>
<div class="bloque">Bloque 3</div>
<div class="bloque">Bloque 4</div>
</div>
I also want it to be centered with respect to the screen.