Style borderTopRightRadius attribute

Definition and usage

borderTopRightRadius This attribute defines the shape of the top right corner of the border.

Tip:This attribute allows you to add rounded border corners to elements!

See also:

CSS reference manual:border-top-right-radius attribute

Example

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

document.getElementById("myDIV").style.borderTopRightRadius = "25px";

Try it yourself

Syntax

Return borderTopRightRadius attribute:

object.style.borderTopRightRadius

Set borderTopRightRadius attribute:

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

Note:The length value and percentage value of the border-top-right-radius attribute define the radius of a quarter ellipse (defining the shape of the corner of the external edge of the border). The first value is the horizontal radius, and the second value is the vertical radius. If the second value is omitted, the first value is copied. If the length is zero, the corner is square, not round. The percentage value of the horizontal radius refers to the width of the border box, and the percentage value of the vertical radius refers to the height of the border box.

Attribute value

Value Description
length Define the shape of the top right corner.
% Define the shape of the top right corner in percentage.
initial Sets this attribute to its default value. See initial.
inherit Inherits this attribute from its parent element. See inherit.

Technical details

Default value: 0
Return value: a string that represents the element's border-top-right-radius attribute.
CSS version: CSS3

browser supports

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Tukuru 9.0 Tukuru Tukuru Tukuru