Style borderRadius Property

❮ Style Object


Add rounded borders to a div element:

document.getElementById("myDIV").style.borderRadius = "25px";
Try it Yourself »

Definition and Usage

The borderRadius property is a shorthand property for setting, or returning, the four border*Radius properties.

Tip: This property allows you to add rounded corners to elements!

Browser Support

borderRadius Yes 9.0 Yes Yes Yes


Return the borderRadius property:

Set the borderRadius property:"1-4 length|% / 1-4 length|%|initial|inherit"

Note: The four values for each radii are given in the order top-left, top-right, bottom-right, bottom-left. If bottom-left is omitted it is the same as top-right. If bottom-right is omitted it is the same as top-left. If top-right is omitted it is the same as top-left.

Property Values

Value Description
length Defines the shape of the corners. Default value is 0
% Defines the shape of the corners 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-radius property of an element
CSS Version CSS3

Related Pages

CSS reference: border-radius property

❮ Style Object