I have this HTML page and I'm trying to position 8 perfect circles on two rows. (4 on each)
I achieved that using flexbox, but then my circle will be broken. I expect this to happen because I don't have a fixed width and height - but the problem is, the circle's dimensions cannot be fixed, because they are set by flex-basis.
Here's the code:
.content-achievements {
width: 100%;
height: 30rem;
position: relative;
border: 1px solid black;
border-radius: 25px;
margin-left: 1.5rem;
text-align: center;
}
.achievements-title {
border: 1px solid black;
border-radius: 1.5rem;
width: 95%;
margin: 1.5rem auto;
height: 2.5rem;
line-height: 2.5rem;
}
.achievements-list {
border: 1px solid black;
width: 95%;
text-align: center;
margin: 0 auto;
border-radius: 1.5rem;
margin-bottom: 1rem;
}
.achievements-items {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-content: center;
gap: 20px;
margin: 1rem 0;
}
.achievements-item {
display: inline-block;
flex-basis: 20%;
border-radius: 50%;
border: 1px solid #000;
line-height: 2rem;
}
<div class="content-achievements">
<div class="achievements-title">
Game Achievements
</div>
<div class="achievements-list">
<ul class="achievements-items">
<li class="achievements-item">achiev1</li>
<li class="achievements-item">achiev2</li>
<li class="achievements-item">achiev3</li>
<li class="achievements-item">achiev4</li>
<li class="achievements-item">achiev5</li>
<li class="achievements-item">achiev6</li>
<li class="achievements-item">achiev7</li>
<li class="achievements-item">achiev8</li>
</ul>
</div>
</div>
How can I fix my circles while also keeping this layout?
Thanks.