THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Style borderTopRightRadius Property

Style Object Reference Style Object

Example

Add a rounded border to the top-right corner of a div element:

document.getElementById("myDIV").style.borderTopRightRadius = "25px";
Try it yourself »

Definition and Usage

The borderTopRightRadius property defines the shape of the border of the top-right corner.

Tip: This property allow you to add rounded borders to elements!


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The borderTopRightRadius property is supported in IE9+, Firefox, Chrome, Safari, and Opera.


Syntax

Return the borderTopRightRadius property:

object.style.borderTopRightRadius

Set the borderTopRightRadius property:

object.style.borderTopRightRadius="length|% [length|%]|initial|inherit"

Note: The two length or percentage values of the border-top-right-radius properties define the radii of a quarter ellipse that defines the shape of the corner of the outer border edge. The first value is the horizontal radius, the second 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. Percentages for the horizontal radius refer to the width of the border box, whereas percentages for the vertical radius refer to the height of the border box.

Property 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. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Technical Details

Default Value: 0
Return Value: A String, representing the border-top-right-radius property of an element
CSS Version CSS3

Related Pages

CSS reference: border-top-right-radius property


Style Object Reference Style Object