CSS border-right-width (Set/Change Width of Right Border)

The CSS border-right-width property is used when we need to set the width of right border of an element. For example:

HTML with CSS Code
<!DOCTYPE html>
<html>
<head>
   <style>
      p {border: 3px solid chocolate; padding: 10px; border-right-width: 10px;}
   </style>
</head>
<body>

   <p>This is a para.</p>
   
</body>
</html>
Output

This is a para.

CSS border-right-width Syntax

The syntax of border-right-width property in CSS, is:

border-right-width: x;

The value of x should be any of the following:

  • thin - used to define thin right border
  • medium - used to define medium right border
  • thick - used to define thick right border
  • length - used to define custom size right border
  • initial - used to define the default value for the size of right border
  • inherit - used to inherit the value from its parent

Note - In all the above, the medium is the default value.

CSS Online Test


« Previous Tutorial Next Tutorial »