border-right-width
defines the width of the right border.
The width is set as a pixel value, or as thin
, medium
, or thick
.
A thick border-right-width
.
<style>
.border-right-thick {
padding: 20px;
width: 300px;
border-right-style: solid;
border-right-color: tomato;
border-right-width: thick;
}
</style>
<div class="border-right-thick">
An element with a thick right border
</div>
The default border-right-width
is medium
or 1 pixel.
A border-right-style value is required for a border to show.
border-right-width: medium | thin | thick | length | initial | inherit;
Value | Description |
---|---|
medium | Default. Medium border |
thin | Thin border |
thick | Thick border |
length | Sets border thickness using CSS units |
initial | Sets the value to its default value. |
inherit | Inherits the value from its parent element. |
Click the buttons to see the different border-right-width
values.
<style>
.border-right-example {
padding: 20px;
width: 300px;
border-right-style: solid;
border-right-color: tomato;
border-right-width: thin;
}
</style>
<div class="border-right-example">
border-right-width: thin
</div>
This table shows when border-right-width
support started for each browser.
Chrome
|
1.0 | Dec 2008 |
Firefox
|
1.0 | Nov 2004 |
IE/Edge
|
4.0 | Sep 1997 |
Opera
|
3.5 | Nov 1998 |
Safari
|
1.0 | Jun 2003 |