border-right - HTML CSS CSS Property

HTML CSS examples for CSS Property:border-right

Description

The border-right CSS property sets the width, style, and color of the right element border.

It is a shorthand property for setting the individual right border properties:

  • border-right-width
  • border-right-style
  • border-right-color.

The following table summarizes the border-right Property.

Item Value
Default value: See individual properties
Applies to:All elements
Inherited: No
Animatable:Yes, See individual properties.

Syntax

The syntax of the property is as follows:


border-right:     [ border-right-width border-right-style border-right-color ] | initial | inherit

Property Values

The following table describes the values of this property.

Value Description
border-right-width Sets the width of the element right border.
border-right-style Sets the line style of the element right border.
border-right-color Sets the color of the element right border.
initialSets this property to its default value.
inherittakes the value of its parent element border-right property.

The example below shows the border-right property.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html lang="en">
 <head>
  <title>Example of CSS border-right property</title>
  <style type="text/css">
    h1 {<!--from  w  w  w .  ja  v  a  2 s . c  o  m-->
      border-right: 5px dashed #ff0000;
    }
    p {
      border-right: 3px dotted #00ff00;
    }
    </style>
 </head>
 <body>
  <h1>This is a heading</h1>
  <p>This is a paragraph.</p>
 </body>
</html>

Related Tutorials