Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A real circular <div> by css or js means

Is there a way to create a real circular div so overflow:hidden can hide everything in the div outside the circular region?

I tried using border-radius, -moz-border-radius, -webkit-border-radius but overflow:hidden only hide things that's outside the square/rectangle region. border-radius is indeed only giving an illusion of a circle.

Then I figured I could create a PNG image with a transparent circular area in the middle surrounded by opaque "background-like" region to hide things outside the circular region, but once again it is yet another illusion and it would be useless when the background is not static but changes accordingly to the screen width & height.

So how can I make a real circular div? By CSS or JS means?

like image 452
Help - I need somebody's help Avatar asked Oct 06 '22 04:10

Help - I need somebody's help


1 Answers

Follow these links may be it helpful to you http://www.css3.info/preview/rounded-border/
http://border-radius.com/
http://www.w3schools.com/cssref/css3_pr_border-radius.asp

like image 60
Usman Ali Avatar answered Oct 10 '22 03:10

Usman Ali