CSS border-color
CSS border-color is used to set the border color. For example, it is often used to set the border color of DIV or span . It can set the color of four borders at a time, or set the color of each border separately, and also can match the border- style (border style), border-width (border width) to present different styles. It should be noted that if the border width is zero (border-width:0px), the border style is none or hidden (border-style: none or border -style: hidden) will not display the border color.
CSS border-color basic syntax
description | grammar |
Set the colors of four borders at once | border-color: color; |
Set the color of the four borders separately | border-color: top border color, right border color, bottom border color, left border color; |
Set the upper and lower borders and the left and right borders separately | border-color: the color of the upper and lower borders, the color of the left and right borders; |
There are three commonly used grammatical techniques in the above table. If the colors of the four borders are the same, use the first simple grammar to specify the colors of the four sides at a time. It will be easier to manage in the future. If you want to design four sides If they are all different colors, the second syntax must be used. The colors are top, right, bottom, and left in order. This is the standard order of CSS and cannot be changed.
CSS border-color example 1. Set the colors of the four borders to be the same
test that all four sides are the same color
</div>
CSS border-color example two, set the color of each border separately, the syntax is as follows
test four sides are all different colors
</div>
CSS border-color example 3: Borders with the same color on the top and bottom and the same color on the left and right
same color up and down and the same color on the left and right borders
</div>
Post a Comment
0 Comments