CSS | border-right Property
The border-right Property is a shorthand property used for all the three Properties that are given below-
- border-right-width
- border-right-style(if required)
- border-right-color
Syntax:
border-right: border-width border-style border-color|initial|inherit;
Property Values-
Syntax:
border-right: border-width border-style border-color
Example:
<!DOCTYPE html> <html> <head> <style> h1 { border-right: 5px solid red; } h2 { border-right: 4px dotted blue; } div { border-right: double; } </style> </head> <body> <h1>A heading with a solid red right border</h1> <h2>A heading with a dotted blue right border</h2> <div>A div element with a double right border.</div> </body> </html> |
chevron_right
filter_none
Output:

Syntax:
border-right:initial;
Example:
<!DOCTYPE html> <html> <head> <style> h1 { color:green; } h3 { border-right: initial; width:20%; } div { border-right: initial; width:40%; } </style> </head> <body> <center> <h1>GeeksForGeeks</h1> <h2> CSS Border-right Property</h2> <h3>geeksforgeeks</h3> <div>It is a computer science portal for geeks.</div> </body> </html> |
chevron_right
filter_none
Output:

Supported Browsers: The browser supported by css border-right property are listed below:
- Apple Safari 1.0
- Google Chrome 1.0
- Firefox 1.0
- Opera 3.5
- Internet Explorer 4.0
Recommended Posts:
- HTML | DOM Style borderRight Property
- CSS | transition-property Property
- CSS | all Property
- CSS | right Property
- CSS | top Property
- CSS | min-width Property
- CSS | hyphens Property
- CSS | z-index Property
- CSS | visibility Property
- CSS | direction Property
- HTML | DOM dir Property
- CSS | filter Property
- CSS | bottom Property
- HTML | DOM id Property
- CSS | resize 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.



