Javascript examples for CSS Style Property:borderRadius
The borderRadius property is a shorthand property for setting, or returning, the four border Radius properties.
The four values for each radii are given in the order top-left, top-right, bottom-right, bottom-left.
Value | Description |
---|---|
length | Radii in length. Default value is 0 |
% | Radii in percentage |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Item | Value |
---|---|
Default Value: | 0 |
Return Value: | A String, representing the border-radius property of an element |
CSS Version | CSS3 |
Set rounded borders to a div element:
<!DOCTYPE html> <html> <head> <style> #myDIV {/* w w w . j a v a2 s . c om*/ border: 1px solid black; width: 300px; height: 300px; } </style> </head> <body> <button onclick="myFunction()">Test</button> <div id="myDIV"> <h1>Hello</h1> </div> <script> function myFunction() { document.getElementById("myDIV").style.borderRadius = "25px"; } </script> </body> </html>