1
Hello! My problem is this:
I made this grid followed by a button. On the desktop it appears correctly, but in mobile the button is superimposed on the grid... Does anyone have any idea what it might be?
(NOTE: The grid in total has 6 images, in print not all appear)
HTML
<div class="section-1-grid">
<div class="section-1-grid-item"><img src="https://i.imgur.com/yVGoimh.png"></div>
<div class="section-1-grid-item"><img src="https://i.imgur.com/yVGoimh.png"></div>
<div class="section-1-grid-item"><img src="https://i.imgur.com/yVGoimh.png"></div>
<div class="section-1-grid-item"><img src="https://i.imgur.com/yVGoimh.png"></div>
<div class="section-1-grid-item"><img src="https://i.imgur.com/yVGoimh.png"></div>
<div class="section-1-grid-item"><img src="https://i.imgur.com/yVGoimh.png"></div>
</div>
<center><a href="#"><button style="cursor: pointer;" class="button button-1">What we do</button></a></center>
CSS
.section-1-grid {
display:grid;
grid-template-columns:auto auto auto;
margin:0 auto;
width:90vw;
grid-row-gap:5%;
grid-column-gap:3%;
margin-bottom:10vw;
}
.section-1-grid-item {
border:none;
}
.button {
border-radius:90px;
padding:15px 30px;
text-align:center;
text-decoration:none;
text-transform:uppercase;
letter-spacing:0.2em;
display:inline;
font-family:'Inter', sans-serif;
font-size:0.8em;
font-weight:800;
transition: all 0.2s;
}
.button-1 {
background:#212121;
border:1px solid #212121;
color:#fff;
}
.button-1:hover {
background:transparent;
color:#212121;
}
@media (max-width: 1024px) {
.section-1-grid {
display:grid;
grid-template-columns:auto;
width:90vw;
grid-row-gap:1%;
}
.button {
border-radius:90px;
padding:4% 8%;
font-size:1.8em;
font-weight:800;
}
}
Perfect! Thank you so much! D
– eaesergio
@eaesergio Grid CSS is still very new, actually not so much, but for some browser is a recent deployment, so there is still a lot of this kind of thing that doesn’t work right. Abs
– hugocsl