border-right
shorthand property defines the width, color, and style of the right border.
Item | Value |
---|---|
Initial value | All elements. |
Inherited | No. |
Version | CSS1 |
JavaScript syntax | object.style.borderRight="5px solid red" |
Applies to |
border-right: border-width border-style border-color;
The property values are listed in the following table.
Value | Description |
---|---|
border-right-width | Set the width of the right border |
border-right-style | Set the style of the right border |
border-right-color | Set the color of the right border |
inherit | Inherit the border-right property from the parent element |
border-right |
Yes | Yes | Yes | Yes | Yes |
An example showing how to use border-right CSS property.
<!DOCTYPE HTML>
<html>
<head>
<style>
div {<!-- www. jav a 2s .c om-->
border-right: 2px dashed darkkhaki;
background: lightyellow;
}
</style>
</head>
<body>
<div>java2s.com</div>
</body>
</html>