CSS2 » Properties » border-width

Version: Level 1

Compability: IE4+  N4+

Syntax:
border-width : thin | medium | thick | length
length
The length value can be in any of the following seven units. Use the abbreviation.
 
Length Abbrev.
centimeters cm
ems em
inches in
millimeters mm
picas pc
pixels px
points pt
thin | medium | thick
The keyword values of thin, medium, or thick can be used to set the width of the border line. The exact thickness of the border created by using these keyword values will be determined by your computer/browser combination.

The border-width property allows you to set the width of all four borders with only one declaration. This property is not inherited.

If you declare one width, all four borders will be that width.
 
You can declare one, two, three or four widths:

If you declare two widths, the top and bottom borders will be the first width, the right and left borders will be the second width.
 
If you declare three widths, the top border will be the first, the right border the second, and the bottom and left borders the third width.
 
If you declare four widths, the order is top, right, bottom, left.

Examples

Code:
body { border-width: thick; }
body { border-width: 0.25in; }
body { border-width: 5mm; }
Language(s): CSS2
Code:
p.bordr
{
border-color: red red red red;
border-style: solid solid solid solid;
border-width: 30px 30px 30px 30px;
}
...
<p class="bordr">
DevGuru is great!
</p>
Output:

DevGuru is great!

Language(s): CSS2

See Also: