The border around an HTML element is, by default, invisible. CSS can be used to make the border visible and customize its style, size and color.
The style of the border must be set before that the size and color can be applied. These can all be set in a single declaration, but let's first take a look at each individual declaration. The following border styles can be applied:
There are four different values that can be used to set the width of each type of border:
The default color for a border, when not otherwise specified, is black. The "border-color" property can be used to specify the color. There are three types of values that can be used:
It is possible to set the style, width and/or color of specific sides of a border, instead of all four sides, by using one or more of the following properties:
And last but not least, you can condense the style, width and color values into a single declaration in one or more of the following manners:
(Keep in mind that although all of our examples here only apply borders to the HTML paragraph element, borders are not at all limited to this HTML element.)