Saturday, August 24, 2013

How to Make Rounded Corners Using CSS

Here all techniques of how to make rounded corners using CSS3.


-moz-border-radius: 10px; /* for Firefox */
-webkit-border-radius: 10px;
-o-border-radius: 10px; /* for Opera */
border-radius: 10px; /* future proofing */
-khtml-border-radius: 10px; /* for old Konqueror browsers */

Individual Corners:

border-radius-topleft: 10px;
border-radius-topright: 20px;
border-radius-bottomright: 30px;
border-radius-bottomleft: 0;

-moz-border-radius-topleft: 10px;
-moz-border-radius-topright: 20px;
-moz-border-radius-bottomright: 30px;
-moz-border-radius-bottomleft: 0;

-webkit-border-top-left-radius: 10px;
-webkit-border-top-right-radius: 20px;
-webkit-border-bottom-right-radius: 30px;
-webkit-border-bottom-left-radius: 0;

-moz-border-radius: [top-left] [top-right] [bottom-right] [bottom-left];

-moz-border-radius: 10px 20px 30px 0;

Elliptical Rounding (Firefox 3.5+):
-moz-border-radius-topleft: [horizontal radius] [vertical radius];

-moz-border-radius-topleft: 10px 40px;

Elliptical Rounding Shorthand (Firefox 3.5+):

-moz-border-radius: 10px / 40px;

-moz-border-radius: 10px 20px 30px 40px / 15px 30px 45px 60px;

-moz-border-radius-topleft: 10px 15px;
-moz-border-radius-topright: 20px 30px;
-moz-border-radius-bottomright: 30px 45px;
-moz-border-radius-bottomleft: 40px 60px;

WebKit Elliptical Rounding:

/* All Corners */
-webkit-border-radius: 36px 12px;

/* Right corners only */

-webkit-border-top-right-radius: 50px 30px;
-webkit-border-bottom-right-radius: 50px 30px;
Disqus Comments