Graphic css3--3rd CSS3 border-2 "

Source: Internet
Author: User
Tags border color

3.2 CSS3 Border Color properties

3.2.1 border-colorSyntax and parameters for attributes

border-colorThe 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-colorThe 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-colorBenefits 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 "

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.