Presently, I have designed a <div>
that adjusts according to screen size.
For wider screens:
https://i.sstatic.net/0X6tq.png
On mobile screens:
https://i.sstatic.net/mYZxE.png
I am looking to create vertical spacing between the two rows on mobile screens. I've attempted adding margins to individual elements, but I don't want the second row to have a margin-bottom
.
https://i.sstatic.net/mpqfo.png
The code I'm working with is shown below:
HTML
<div class="stats-flexwrap">
<div class="stats">
<span class="stats-row"><span>element 1</span>
<span class="stats-row"><span>element 2</span>
<span class="stats-row"><span>element 3</span>
<span class="stats-row"><span>element 4</span>
</div>
</div>
CSS
.stats-row {
text-align: center;
margin: 0 16px;
}
.stats {
width: auto;
display: flex;
}
@media screen and (max-width: 788px) {
.stats {
flex-wrap: wrap;
justify-content: center;
max-width: 100%;
margin: 0;
height: auto;
}
.stats-row {
margin: 0 16px 0 16px !important;
width: 120px;
}
}
.stats-flexwrap {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}