border-width: ***; border-***-width: ***;
Browser |
|
---|
The border-width and border-***-width properties sets the border width of an element.
(*** = top, bottom, left, and right)
- border-width : This is a shorthand property for setting the width for the four borders.
- border-***-width : Sets the width of the top, bottom, left, and right borders.
div {
border-width: medium thin;
border-color: #000000;
border-style: solid;
}
p {
border-top-width: 3px;
border-right-width: 6px;
border-bottom-width: 9px;
border-left-width: 12px;
border-color: #000000;
border-style: solid;
}
border-width
: This is a shorthand property for setting the width for the four borders.
Property | Value | Explanation |
---|---|---|
border-width | thin, medium , thick, or length | the top, bottom, left, and right borders |
The default is "medium".
border-width: 5px;
: [all sides] bordersborder-width: 5px 10px;
: [top, bottom] [left, right] bordersborder-width: 5px 10px 15px;
: [top] [left, right] [bottom] bordersborder-width: 5px 10px 15px 20px;
: [top] [right] [bottom] [left] borders
border-***-width
: Sets the width of the top, bottom, left, and right borders.
Property | Value | Explanation |
---|---|---|
border-top-width | thin, medium , thick, or length | the top border |
border-right-width | thin, medium , thick, or length | the right border |
border-bottom-width | thin, medium , thick, or length | the bottom border |
border-left-width | thin, medium , thick, or length | the left border |
The default is "medium".
The thickness example
thin
medium
thick
1px
2px
3px
5px
10px