The border-color property sets the color of the four borders of an
element. This property can have one to four values.
EXAMPLE
RESULT
If the property has four values:
border-color: orange, yellow, greenyellow, blue; it means:
The top border is orange.
The right border is yellow.
The bottom border is greenyellow.
The left border is blue.
If the property has three values: border-color: orange, yellow, blue; it
means:
The top border is orange.
The right and left borders are yellow.
The bottom border is blue.
If the property has two values: border-color: orange, yellow; it means:
The top and bottom borders are orange.
The right and left borders are yellow.
If the property has one value: border-color: orange; it means:
All four borders are orange.
The border-style property must always be declared before the
border-color property because the element needs to have borders before we can set their colors.
We use cookies for a better user experience and website functionality.