border-radius property
Specifies the radii of a quarter ellipse that defines the shape of the corners for the outer border edge of the current box.
![]() ![]() |
Syntax
border-radius: [
<length>
|
<percentage>
]
{1,4}
[ / [
<length>
|
<percentage>
]
{1,4}
] ?
Property values
One to eight of the following values, separated by an optional slash ("/"):
- length
-
Floating-point number, followed by a supported length unit.
- percentage
-
Integer, followed by a %. The value is a percentage of, for horizontal radii, the width of the border box, or, for vertical radii, the height of the border box.
CSS information
| Applies To | All elements |
|---|---|
| Media | visual |
| Inherited | no |
| Initial Value | (see individual properties) |
Standards information
- CSS Backgrounds and Borders Module Level 3, Section 5.1
Remarks
As of Microsoft Edge, "-webkit-border-radius" is supported as an alias for this property.
The border-radius property is a composite property that specifies up to four border-*-radius properties. If values are given before and after the slash, the values before the slash set the horizontal radius and the values after the slash set the vertical radius. If there is no slash, the values set both radii equally.
The four values for each radius are given in the following order:
- top left (equivalent to the border-top-left-radius property)
- top right (equivalent to the border-top-right-radius property)
- bottom right (equivalent to the border-bottom-right-radius property)
- bottom left (equivalent to the border-bottom-left-radius property)
If the bottom-left value is omitted, the value is the same as the top-right value. If the bottom-right value is omitted, the value is the same as the top-left value. If the top-right value is omitted, the value is the same as the top-left value.
For more information about the border-radius property and related properties, see How to Add Rounded Corners with CSS3.
Examples
Following is an example of a typical use for the border-radius property. Because there are two values after the border-radius property, the first value is the radius of the circle that defines the top-left and bottom-right corners of the element, and the second value is the radius of the circle that defines the top-right and bottom-left corners of the element.
div.rounded {
width: 800px;
height: 600px;
border: solid black 10px;
border-radius: 15px 10px
}
This example appears as follows in Internet Explorer 9 and later.

The following two selectors are equivalent; they produce identical results.
div.shorthand {
border-radius: 40px;
}
div.all4properties {
border-top-left-radius: 40px;
border-top-right-radius: 40px;
border-bottom-right-radius: 40px;
border-bottom-left-radius: 40px;
}
The following two selectors are also equivalent.
div.shorthand2 {
border-radius: 2em 1em 4em / 0.5em 3em;
}
div.all4properties2 {
border-top-left-radius: 2em 0.5em;
border-top-right-radius: 1em 3em;
border-bottom-right-radius: 4em 0.5em;
border-bottom-left-radius: 1em 3em;
}
See also
- CSSStyleDeclaration
- currentStyle
- defaults
- runtimeStyle
- style
- Demos
- IE Test Drive: Border Radius
- IE Test Drive: IE Logo
- Conceptual
- How to Add Rounded Corners with CSS3
- Internet Explorer 9 Guide for Developers: CSS3 Backgrounds and Borders Module
- Reference
- border-top-right-radius
- border-bottom-left-radius
- border-bottom-right-radius
- border-top-left-radius

