Sometimes, we want to draw a circle on an HTML page.
In this article, we’ll look at how to draw a circle on an HTML page.
How to draw a circle on an HTML page?
To draw a circle on an HTML page, we set the border-radius.
For instance, we write
<div id="circle"></div>
to add a div.
Then we write
#circle {
width: 50px;
height: 50px;
-webkit-border-radius: 25px;
-moz-border-radius: 25px;
border-radius: 25px;
background: red;
}
to set the border-radius to make the corners of the div round.
And we set the width and height so that it looks like a circle.
Conclusion
To draw a circle on an HTML page, we set the border-radius.