I am looking to align items in a specific way.
My goal is to have 4 items in one row, and then the remaining 3 items in the next row, all centered.
Despite setting the width at 25%, I am encountering some issues with alignment.
Please check out the code snippet here
.flex-container {
display: flex;
flex-flow: row wrap;
text-align: center;
width: 100%;
}
.quarter {
width: 24.6%;
padding: 20px;
background-color: #b5d46e;
border: 3px solid white;
color: white;
font-size: 1.5em;
text-align: center;
}
<div class='flex-container'>
<div class='quarter flex-item'>
<h3>1</h3>
</div>
<div class='quarter flex-item'>
<h3>2</h3>
</div>
<div class='quarter flex-item'>
<h3>3</h3>
</div>
<div class='quarter flex-item'>
<h3>4</h3>
</div>
<div class='quarter flex-item'>
<h3>5</h3>
</div>
<div class='quarter flex-item'>
<h3>6</h3>
</div>
<div class='quarter flex-item'>
<h3>7</h3>
</div>
<div class='quarter flex-item'>
<h3>8</h3>
</div>
</div>