English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
border-right css attribute sets the width, style, and color of the element's right border. It is used to set a single right border attribute (i.e., to setborder-right-width,border-right-styleandborder-right-colorThe shorthand attribute of )
The following table provides usage instructions and version history of this attribute, as well as its usage syntax in JavaScript scripts.
Default value: | View all properties |
---|---|
Applicable to: | All elements |
Inheritance: | None |
Animaatable: | Yes,Please refer to individual properties.Please refer to Animation properties. |
Version: | CSS 1,2,3 |
JavaScript syntax: | object object.style.borderRight="3px solid red" |
The syntax of this attribute is as follows:
border-right: [ border-right-width border-right-style border-right-color ] | initial | inherit
The following example demonstrates how to use border-right attribute.
h1 { border-right: 5px dashed #ff0000; } p { border-right: 3px dotted #00ff00; }Test and see‹/›
The following table describes the value of this attribute.
Value | Description |
---|---|
border-right-width | Set the width of the element's right border. |
border-right-style | Set the line style of the element's right border. |
border-right-color | Set the color of the element's right border. |
initial | Set this property to its default value. |
inherit | If specified, the associated element uses its parent element's border-right attribute value. |
border-The compatibility of the right attribute in browsers, the numbers in the table below represent the minimum version number of the browsers that support this attribute; all mainstream browsers support this attribute.
|
See tutorial:CSS Border,CSS3 Border.
Related properties:border,border-right-color,border-right-style,border-right-width.