CSS border Property
The border property in CSS is used to style the border of an element. This property is a combination of three other properties border-width, border-style, and border-color as can be used as a shorthand notation for these three properties. It sets or returns the border-width, border-style, border-color Properties.
Syntax:
border = "width style color|initial|inherit"
Values:
- width: This value specifies the weight or the width of the border.
- style: This value specifies a style for the border, that is whether the border will be dotted, dashed, solid etc.
- color: This value specifies the color of the border.
Below code illustrates the border property in CSS:
<!DOCTYPE html> <html> <head> <style> h1 { color: green; } #gfg { <!--border property with--> <!--width=4px--> <!--style=solid--> <!--color=blue--> border: 4px solid blue; width: 60%; } </style> </head> <body> <center> <h1>GeeksForGeeks</h1> <h2>DOM Style border Property</h2> <!-- Element whose border will be styled --> <div id="gfg"> GeeksForGeeks. It is a computer science portal for geeks.. </div> <br> <button type="button">Submit</button> </center> </body> </html> |
Output:

Supported Browsers: The browser supported by DOM style border property are listed below:
- Apple Safari 1.0
- Google Chrome 1.0
- Firefox 1.0
- Opera 3.5
- Internet Explorer 4.0
Recommended Posts:
- CSS | border-top Property
- CSS | border-right Property
- CSS | border-style Property
- CSS border-spacing Property
- CSS | border-left Property
- CSS | border-right-style Property
- CSS | border-top-width Property
- CSS | border-width Property
- CSS | border-top-color Property
- CSS | border-image Property
- CSS border-bottom Property
- CSS | border-top-style Property
- CSS | border radius property
- CSS | border-collapse Property
- CSS | border-color 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.



