English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules (RULES)

Comprehensive CSS Properties

CSS border-right-width Attribute Usage and Example

border-right-How to use the width CSS attribute to set the width of the right border of an element separately. However, in many cases, like   border-widthorborder-right Such shorthand CSS attributes are more convenient and preferable to use.

The following table provides usage instructions and version history of this attribute, as well as the syntax of using this attribute in JavaScript scripts.

Default Value:medium
Applicable To:All Elements
Inheritance:No
Animated:Yes.Please refer to Animation Attribute.
Version:CSS 1,2,3
JavaScript Syntax:    
object.style.borderRightWidth="thick"

border-right-The syntax of width

The syntax of this attribute is as follows:

border-right-width: thin | medium | thick | length | initial | inherit

The following examples demonstrate how to use border-right-width attribute.

  p {
   border-style: solid;
   border-right-width: 15px;
  }
Test and see‹/›

Note:You must specify in border-bottom-width attribute was declared beforeborder-styleAttribute. The element must have a border before the border width can be set, because theborder-styleThe default value of the attribute is none.

Attribute Value

The following table describes the value of this attribute.

ValueDescription
thinThin border.
mediumMedium border.
thickThick border.
lengthLength values in units such as px, pt, cm, em, etc., but negative values are not allowed.
initialSet this attribute to its default value.
inheritIf specified, the associated element adopts its parent element's border-right-The value of width attribute.

Browser Compatibility

border-right-Browser Compatibility of width Attribute, the numbers in the table below represent the minimum version number of browsers that support this attribute; all mainstream browsers support this attribute.

  • Firefox 1+

  • Google Chrome1+

  • Internet Explorer 4+

  • Apple Safari 1+

  • Opera 4+

Further Reading

Please refer to the following tutorials:CSS Border.

Related Attributes:border,border-width,border-right,border-right-color,
border-right-style.