Syntax | selector {border-width: width width width width;}
(OR)
selector {border-width: value;}
|
---|---|
Usage | The border-width property is used as a shorthand method to specify all 4 border widths in one place. See the Box Model for a description of the boxes that are generated for elements and the relative position of the borders.
CSS Example: Four different border-width properties are set by specifying one, two, three, and four width values respectively. #sample1 {border: thin solid red; border-width: 3px; } #sample2 {border: thin solid red; border-width: thick 1px; } #sample3 {border: thin solid red; border-width: 1px medium 0.5em; } #sample4 {border: thin solid red; border-width: 5px 10px 15px 20px; } |
Keywords |
|
Applies To | All elements |
Inherited | No |
Initial Value | medium for each of the four individual border sides. |
Four different border-width properties are set by specifying one, two, three, and four width values respectively. |