Latest web development tutorials

HTML DOM Style borderRadius property

Style Object Reference Style Objects

Examples

Add rounded corners to a div element:

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

try it"

Definition and Usage

borderRadius property is a shorthand property sets or returns four border-radius property.

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


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

IE9 +, Firefox, Chrome, Safari and Opera support borderRadius property.


grammar

Back borderRadius properties:

object .style.borderRadius

Setting borderRadius properties:

object .style.borderRadius="1-4 length|%/1-4 length|%|initial|inherit"

Note: for thefour values in accordance with the radius of the upper-left, upper right, lower right, lower left, in the order given. If the value of the left will be omitted, its value is consistent with the value in the upper right. If the value of the lower right will be omitted, its value is consistent with the value of the upper left. If the value of the upper right will be omitted, its value is consistent with the value of the upper left.

Property Value

描述
length 定义角的形状。默认值是 0。
% 以 % 形式定义角的形状。
initial 设置该属性为它的默认值。请参阅 initial
inherit 从父元素继承该属性。请参阅 inherit

technical details

Defaults: 0
return value: String representing the border-radius property element.
CSS version CSS3


related articles

CSS Reference: border-RADIUS attribute


Style Object Reference Style Objects