CSS Property: border
The width, style, and color of all four sides of the border of a box.
A shorthand property that combines border-top, border-right, border-bottom, and border-left, along with border-width, border-style, and border-color.
Possible Values
A space-separated list, containing up to three values representing border-width, border-style, and border-color. Any excluded values will default to their initial value.
| Value | Description | Example |
|---|---|---|
| [width] (equivalent of single border-width value) |
|
2px |
| [style] (equivalent of single border-style value) |
|
solid |
| [color] (equivalent of single border-color value) |
|
red |
| [width] [style] |
|
2px solid |
| [width] [color] |
|
2px red |
| [style] [color] |
|
solid red |
| [width] [style] [color] |
|
2px solid red |
inherit | ||
initial | ||
unset | ||
Example
#animal { border: 1px solid #000; }
