CSS border-widthProperty
Example
Set the width of the four borders:
p
{
border-style:solid;
border-width:15px;
}
Try it Yourself »
Property definition and usage instructions
The border-width property sets the width of an element's four borders. This property can have one to four values.
Example:
border-width:thin medium thick 10px;
- The top border is a thin border.
- The right border is a medium border
- The bottom border is a thick border.
- The left border is a 10px wide border
border-width:thin medium thick;
- The top border is a thin border.
- The right and left borders are medium borders
- The bottom border is a thick border.
border-width:thin medium;
- The top and bottom borders are thin borders
- The right and left borders are medium borders
border-width:thin;
- All four borders are thin borders
| Default value: | medium |
|---|---|
| Inheritance: | no |
| version: | CSS1 |
| JavaScript Syntax: | object.style.borderWidth="thin thick" |
Browser Support
The numbers in the table indicate the first browser version that supports the property.
| Property | |||||
|---|---|---|---|---|---|
| border-width | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Property value
| Value | Description |
|---|---|
| thin | Define thin borders. |
| medium | Default. Defines a medium border. |
| thick | Define thick borders. |
| length | Allows you to customize the width of the border. |
| inherit | Specifies that the border width should be inherited from the parent element. |
Related Articles
CSS Tutorial:CSS Border
other extensions