How to create a circle in CSS
CSS is a web programming language that is capable of creating a lot of shapes. Circles in CSS are created by declaring a few parameters.
Parameters
There are 4 parameters of a circle in CSS:
width: This defines the horizontal stretch of the circle.height: This defines the vertical stretch of the circle.background: This defines the color of the circle.border-radius: This defines the radius of the circle’s border and must remain 50%. (You must keep width and height equal so that it remains a circle. The border-radius must remain 50%, however, try changing it to check the effect)
Example
This code creates a circle in CSS. According to your preferences, you may change the color, width, or height. However, you must keep width and height equal so that it remains a circle.
Note: The border-radius must remain 50%.
Free Resources
Copyright ©2026 Educative, Inc. All rights reserved