Shorthand property that defines the border-width, border-style and border-color of an element’s right border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the right border — border-right-width, border-right-style and border-right-color.
Overview tableFor style values, the initial value is none. For color values, the initial value is currentColor. For width values, the initial value is medium, which is computed as about 3px in most browsers.
borderRight
border-right: border-width border-style color
border-right: inherit
border-right
property can contain up to three components:
border-width
: This takes a numeric value with any of the standard length units.border-style
: This takes any of the range of style values available to the border-style property, which includes none
, hidden
, dotted
, dashed
, solid
, double
, groove
, ridge
, inset
, outset
. For more details about each, see the border-style page.color
: This can take any valid CSS color as its value.inherit
, the element will inherit the border values set on its parent.
A simple example showing multiple <div>
s, identical in style except that they have different border-right
properties applied to them.
<div class="one"><p>One</p></div>
<div class="two"><p>Two</p></div>
<div class="three"><p>Three</p></div>
<div class="four"><p>Four</p></div>
<div class="five"><p>Five</p></div>
div {
width: 150px;
height: 50px;
margin: 1rem;
float: left;
}
p {
padding: 0.25rem;
}
.one {
border-right: 1px solid black;
}
.two {
border-right: 4px dashed;
}
.three {
border-right: dotted red;
}
.four {
border-right: 10px black;
}
.five {
border: 1px inset black;
border-right: 10px inset rgba(234,190,50,0.75);
}
Usage
* It is usual to use the border-right property to set the default state of a box's right border, and then override individual values using more specific propeties, such as border-right-width or border-right-color.
border-right
can be used as a divider between horizontally laid out items, such as a horizontal navigation menu, or table cells.border-right
Reference
Other Resources
CSS Enhancements in Internet Explorer 6
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4