Style borderTopRightRadius Property
Example
Add a rounded border to the top-right corner of a div element:
document.getElementById("myDIV").style.borderTopRightRadius="25px";
Try it »
Definition and Usage
The borderTopRightRadius property sets or returns the shape of the top-right corner border.
**Tip:** This property allows you to add rounded borders to an element!
Browser support

IE9+, Firefox, Chrome, Safari, and Opera support the borderTopRightRadius property.
Syntax
Return the borderTopRightRadius property:
object
.style.borderTopRightRadius
Set the borderTopRightRadius property:
object
.style.borderTopRightRadius="
length
|
%
[
length
|
%
]|initial|inherit"
**Note:** The two values of length or percentage for border-top-right-radius define the radius of a quarter ellipse, that is, the shape of the corner of the outer border edge. The first value is the horizontal radius, and the second value is the vertical radius. If the second value is omitted, it is copied from the first value. If both lengths are 0, the corner is square, not round. The percentage for the horizontal radius is relative to the width of the bounding box, and the percentage for the vertical radius is relative to the height of the bounding box.
Attribute values
| Value | Description |
|---|---|
| length | Defines the shape of the top-right corner. |
| % | Defines the shape of the top-right corner in %. |
| initial | Sets this property to its default value. See initial. |
| inherit | Inherits this property from its parent element. See inherit. |
Technical Details
| Default value: | 0 |
|---|---|
| Return Value: | A string that represents the border-top-right-radius property of an element. |
| CSS version | CSS3 |
Related Articles
CSS Reference Manual:border-top-right-radius property
The Style object