Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make circular background using css?

Tags:

css

I need make something like this. and I want to do it for a <div></div> which has width in %

enter image description here

I can do this by using an image and adding another div inside and z-index.

But I want to know if it's possible to make in this circle in backgroud using css.

like image 943
Jitendra Vyas Avatar asked Jan 03 '12 07:01

Jitendra Vyas


People also ask

How do you make a circle style in CSS?

To create a circle we can set the border-radius on the element. This will create curved corners on the element. If we set it to 50% it will create a circle. If you set a different width and height we will get an oval instead.

How do I make a circle around a circle in CSS?

To make a circle, use border-radius: 50% . Then just position 6 circular divs with absolute positioning around the larger circle.


2 Answers

Keep it simple:

.circle   {     border-radius: 50%;     width: 200px;     height: 200px;    } 

Width and height can be anything, as long as they're equal

like image 140
Gal Margalit Avatar answered Oct 07 '22 06:10

Gal Margalit


Check with following css. Demo

.circle {     width: 140px;    height: 140px;    background: red;     -moz-border-radius: 70px;     -webkit-border-radius: 70px;     border-radius: 70px; } 

For more shapes you can follow following urls:

http://davidwalsh.name/css-triangles

like image 33
Swarnamayee Mallia Avatar answered Oct 07 '22 05:10

Swarnamayee Mallia