HTML | DOM Style borderRadius Property
The DOM Style borderRadius Property is used to set or return the four different borderRadius property such as borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius of an element. It is used to add the rounded corner in an element.
Syntax:
object.style.borderRadius
object.style.borderRadius = "1-4 length|% / 1-4 length|% |initial|inherit"
Property values:
- length: This will define the shape of the corner default value is 0.
- %: This will also define the shape of corner in percentage.
- initial: This will set the property to it’s default value.
- inherit: This will inherit the property from it’s parent element.
Return Value: It returns a string value which represent the top, left, bottom borderRadius of an element.
Example:
<!DOCTYPE html> <html> <head> <title>DOM Style borderRadius Property</title> <style> ' h1 { color: green; font-size: 35px; } #GFG { background: #009900; padding: 30px; text-align: center; width: 300px; height: 120px; } </style> </head> <body> <center> <h1>GeeksForGeeks</h1> <h2>DOM Style borderRadius Property</H2> <div id="GFG"> <h2>GeeksforGeeks</h2> </div> <br> <button onclick="Geeks()">Submit</button> <script> function Geeks() { document.getElementById("GFG").style.borderRadius = "25px"; } </script> </center> </body> </html> |
Output:
Before clicking on the button:

After clicking on the button:
Supported Browsers: The browser supported by DOM Style borderRadius property are listed below:
- Google Chrome 1.0
- Internet Explorer 4.0
- Firefox 1.0
- Opera 3.5
- Apple Safari 1.0
Recommended Posts:
- HTML | DOM Style right Property
- HTML | DOM Style top Property
- HTML | DOM Style isolation Property
- HTML | DOM Style transitionProperty Property
- HTML | DOM Style animationDirection Property
- HTML | DOM Style animationTimingFunction Property
- HTML | DOM Style visibility Property
- HTML | DOM Style opacity Property
- HTML | DOM Style height Property
- HTML | DOM Style whiteSpace Property
- HTML | DOM Style transitionDelay Property
- HTML | DOM Style columnRuleColor Property
- HTML | DOM Style position Property
- HTML | DOM Style cssFloat Property
- HTML | DOM Style columns Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



