3.2 CSS3 Border Color properties
3.2.1
border-color
Syntax and parameters for attributes
border-color
The syntax looks exactly the same as in CSS1, but in order to avoid conflicts with the border-color
original function of the attribute, CSS3 has made some modifications to this attribute. The syntax is as follows:
border-color : [ <color> | transparent ] { 1, 4} | inherit
In other words, if you use border-color
this abbreviation syntax, there will be no effect, you must border-color
split the standard notation into four borders and use multiple colors to be effective.
border-top-colors : [ <color> | transparent ] { 1, 4} | inherit
border-right-colors : [ <color> | transparent ] { 1, 4} | inherit
;
border-bottom-colors : [ <color> | transparent ] { 1, 4} | inherit
;
border-left-colors : [ <color> | transparent ] { 1, 4} | inherit
;
The color in the above four attributes is a complex number colors, and if the letter is missing in the writing process s
, nothing happens. because the properties of CSS3 have border-color
not yet become standard specifications, it is necessary to add a browser prefix in order for different browsers to render properly.
border-color
The parameters of the property are actually very simple, that is, the color value <color>
, can be any legal color value or a list of color values. When you set only one color, the effect is the border-color
same as in CSS1. Only n colors are set and the border width is also n pixels, you can use the CSS3 border-color
property to set n colors, each color shows 1 pixels, and if the width value is greater than the number of colors, the last color is used to show the remaining width.
3.2.2 Browser compatibility
Currently (December 8, 2016) only Firefox support is required with a -moz-
prefix.
3.2.3
border-color
Benefits of attributes
In the CSS2 to achieve a multi-color border effect, there is no difference between the two methods, one by adding additional tags, on each label to set a different color, and the other is through the background image to create. These two methods and CSS3 border-color
comparison are slightly disadvantage, the first kind of more tags, so that the structure of redundancy, the second method background image is not maintenance, especially when changing the color of the border is more trouble.
3.2.4 to achieve physical examination: three-dimensional gradient border effect
<!DOCTYPE html>
Graphical css3--3rd CSS3 border-2 "