The border-right property is a CSS property that is used to set the style, width, and color of the right border of an element. It is one of the border properties that can be used to create a border around an HTML element. The border-right property is used to set the style of the right border of an element, which can be solid, dotted, dashed, double, groove, ridge, inset, outset, or none.
The border-right property can be used with other border properties such as border-top, border-bottom, and border-left to create a complete border around an element. The border-right property can also be used with the border-radius property to create rounded corners on the right side of an element.
The syntax for the border-right property is as follows:
border-right: width style color;
The width, style, and color values are optional, but at least one value must be specified. If only one value is specified, it is used for the border-right-width property, and the border-right-style and border-right-color properties are set to their default values.
Here are some examples of using the border-right property:
/* Set the right border of an element to a solid red line */
border-right: 1px solid red;
/* Set the right border of an element to a dotted blue line */
border-right: 2px dotted blue;
/* Set the right border of an element to a double green line */
border-right: 3px double green;
The border-right property can also be used with the border-radius property to create rounded corners on the right side of an element:
/* Set the right border of an element to a solid red line with a rounded corner */
border-right: 1px solid red;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
The border-right property is supported by all major web browsers, including Chrome, Firefox, Safari, and Internet Explorer.
The border-right property is a useful CSS property that can be used to set the style, width, and color of the right border of an element. It can be used with other border properties to create a complete border around an element, and it can also be used with the border-radius property to create rounded corners on the right side of an element.