If my HTML structure looks like this:
<li>
<a>
<h2></h2>
<img>
<p></p>
<button></button>
</a>
</li>
Desiring a perfectly round image, I attempted the following CSS after reading about it in this article:
.circle-box {
width: 70%;
height: 0;
margin-top: 10px;
padding-bottom: 70%;
border-radius: 50%;
}
The issue is that the image does not appear due to height: 0;
. Removing it results in a vertically elongated oval image where only half is rounded, as shown below:
How can I resolve this problem?