I want to place icons at the edge of their parent (the circle), like this:
I tried some ways, but in default absolute children placed at the start position of their parent, like this:
Even the parent has a circle shape (border-radius: 50%;
)
I don't want to use margin
or position
for every single child, because their number is dynamic.
Is there any way to place children at the edge of their parent?
.circle {
position: relative;
width: 300px;
height: 300px;
background: rgba(0, 0, 0, 0.2);
display: flex;
align-items: center;
border-radius: 50%;
}
.menu {
list-style-type: none;
display: flex;
flex-direction: column;
justify-content: center;
padding: 0;
margin: 0;
position: absolute;
right: 5px;
}
.menu li {
margin: 5px 0;
}
.menu li a {
display: block;
}
.menu li a img {
width: 50px;
}
<div class="circle">
<ul class="menu">
<li>
<a href="#instagram">
<img src="https://img.icons8.com/cotton/344/instagram-new.png" />
</a>
</li>
<li>
<a href="#chrome">
<img src="https://img.icons8.com/cotton/344/chrome.png" />
</a>
</li>
<li>
<a href="#youtube">
<img src="https://img.icons8.com/cotton/344/youtube.png" />
</a>
</li>
</ul>
</div>