CSS border-width property
Example
Set the widths of the four borders:
p
{
border-style:
solid
;
border-width:
15
px
;
}
Try it »
Property definition and usage
The border-width property sets the widths of all four borders of an element. This property can have one to four values.
Example:
**border-width:thin medium thick 10px; **
- The top border is thin
- The right border is medium
- The bottom border is thick
- The left border is 10px wide
border-width:thin medium thick;
- The top border is thin
- The right and left borders are medium
- The bottom border is thick
border-width:thin medium;
- The top and bottom borders are thin
- The right and left borders are medium
border-width:thin;
- All four borders are thin
| 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 this property.
| property | |||||
|---|---|---|---|---|---|
| border-width | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Attribute values
| Value | Description |
|---|---|
| thin | Defines a thin border. |
| medium | Default. Defines a medium border. |
| thick | Defines a thick border. |
| 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