tags:

views:

267

answers:

4

I would like to use CSS to create nice round border. I'm aware of the following CSS Style:

 border-radius
-webkit-border-radius
-moz-border-radius

Which style(s) are the best to use?

+5  A: 

You should use all three rules.

This way, your page will work both on current versions of Mozilla and WebKit and on future browsers that implement the standard.

SLaks
+1  A: 

You should use all of them (for now). -moz targets Mozilla browsers and -webkit targets Webkit browsers. Technically you don't need the plain border-radius but best practices say you should include it so when CSS3 goes live you already have it implemented.

DM
+1  A: 

-webkit-border-radius is for webkit based browsers such as Safari & Chrome. -moz-border-radius is for Mozilla products such as Firefox. border-radius is what will be used when the standard is finalised, although Opera currently uses it.

Use all 3 to ensure the most compatibility.

hell0w0rld
+3  A: 
/* Gecko browsers */
-moz-border-radius: 5px; 
/* Webkit browsers */
-webkit-border-radius: 5px; 
/* W3C syntax - likely to be standard so use for future proofing */
border-radius: 5px;

Internet Explorer 6 & 7 and 8 (as far as I know) and Opera do not support rounded corners. Instead these users will see a regular corner.

You can get started using Firefox and any of the 'Mozilla' family of browsers. Apple's WebKit web browser engine also supports rounded corners making them available in the Safari and Chrome web browsers, the iPhone and other devices running WebKit.

Detailed Answer of your question is here

http://shapeshed.com/journal/css3_tour_border-radius/

and for IE use these solution http://woork.blogspot.com/2009/08/css3-rounded-corners-for-every-browser.html

http://www.css3.info/a-border-radius-solution/

see some more cool info here about corners http://www.the-art-of-web.com/css/border-radius/

metal-gear-solid
Why do you use 10px as a value for border-radius, and not 5px? Just nitpicking, but now it might seem that one has to double the value of the other rules.
Marcel Korpel
He just copied the example directly from that first link. I've changed them all to `5px`, as there should be no difference.
DisgruntledGoat
Opera 10.5 now supports `border-radius`, and IE9 will too.
mercator