| Syntax | selector {border-style: style style style style;}
(OR)
selector {border-style: value;}
|
|---|---|
| Usage | The border-style property is used as a shorthand method to specify all 4 border styles 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-style properties are set by specifying one, two, three, and four style values respectively. #sample1 {border: medium solid red;
border-style: dotted;
}
#sample2 {border: medium solid red;
border-style: dashed double;
}
#sample3 {border: medium solid red;
border-style: dotted double dashed;
}
#sample4 {border: medium solid red;
border-style: solid dotted double dashed;
}![]() ![]() ![]() |
| Keywords |
Note: The border samples, shown above, may not appear identically in all browsers. |
| Applies To | All elements |
| Inherited | No |
| Initial Value | none for each of the four individual border sides. |
![]() ![]() Four different border-style properties are set by specifying one, two, three, and four style values respectively. |