HTML CSS examples for CSS Property:border-right
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:
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. |
The syntax of the property is as follows:
border-right: [ border-right-width border-right-style border-right-color ] | initial | inherit
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. |
initial | Sets this property to its default value. |
inherit | takes the value of its parent element border-right property. |
The example below shows the border-right property.
<!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>