Struggling with alignment while trying to create a block legend, seeking advice for correction:
.footertext {
display: flex; /* setting up flex container */
flex-direction: row; /* default value; can be omitted */
flex-wrap: nowrap; /* default value; can be omitted */
justify-content: space-between;
width: 260px;
margin-top: 30px;
background: yellow;
}
.circlemarker {
height: 15px;
width: 15px;
border-radius: 50%;
margin-right: 78px;
box-shadow: 6px 6px 10px -1px rgba(0, 0, 0, 0.10),
-6px -6px 10px -1px rgba(255, 255, 255, 0.7);
}
.circlemarker p {
padding-left: 20px;
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 14px;
}
#accactive {
background: #1698D1;
}
#accdisabled {
background: #979797;
}
#accprivileged {
background: #FF9563;
}
<div class="footertext">
<div>
<div class="circlemarker" id="accactive" ><p>Active</p></div>
</div>
<div>
<div class="circlemarker" id="accdisabled"><p>Disabled</p></div>
</div>
<div>
<div class="circlemarker" id="accprivileged"><p>Privileged</p></div>
</div>
</div>
It almost looks okay after adding
margin-right: 78px;
However, using such hardcoded values may not always be ideal as the size changes. How can I adjust the CSS so it looks consistent regardless of the margin? Additionally, it seems that it is not vertically centered. P.S. The yellow background is just for visualizing the parent boundaries.