Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

circle
css
create

How to create a circle in CSS

Educative Answers Team

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.

svg viewer

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%.

RELATED TAGS

circle
css
create
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring