CSS3 border-top-right-radius property
Example
Add a rounded border to the top-right corner of a div element:
div
{
border:2px solid;
border-top-right-radius:2em;
}
Try it »
Browser support
The numbers in the table indicate the first browser version that supports this property.
A number immediately before -webkit-, -ms-, or -moz- indicates the first browser version that supports that prefixed property.
| property | |||||
|---|---|---|---|---|---|
| border-radius | 9.0 | 5.0 | |||
| 4.0 -webkit- | 4.0 | ||||
| 3.0 -moz- | 5.0 | ||||
| 3.1 -webkit- | 10.5 |
Property definition and usage
The border-top-right-radius property defines the shape of the top-right border corner.
Tip: This property allows you to add rounded borders to an element!
| Default value: | 0 |
|---|---|
| Inherited: | no |
| Version: | CSS3 |
| JavaScript syntax: | object object.style.borderTopRightRadius="5px" |
Syntax
border-top-right-radius:
length
|
%
[
length
|
%
];
Note: The two length or percentage values of the border-top-right-radius property define the shape of the corner as a quarter of an ellipse's outer border edge. The first value is the horizontal radius, the second is the vertical radius. If the second value is omitted, it is copied from the first. If either length is zero, the corner is square, not rounded. The percentage of the horizontal radius refers to the width of the bounding box, while the percentage of the vertical radius refers to the height of the bounding box.
| Value | Description |
|---|---|
| length | Defines the shape of the top-right corner. |
| % | Use % to define the shape of the top-right corner. |
Related Articles
CSS3 tutorial: CSS3 Borders