"Gradient" compatibility solution in css3, css3 gradient

Source: Internet
Author: User

"Gradient" compatibility solution in css3, css3 gradient

This is a simple question about the compatibility of our common gradient in various browsers.
Our well-known browsers include Chrome, Firefox, Opera, Safari, and ie series. The most basic background: # cccccc attribute indicates page rendering # cccccc color. Of course, this is true in any browser. However, as we increase our color requirements, we have introduced the gradient linear-gradient. Different browsers need to add different prefixes to their cognition. Through the above example, we can know that firefox:-moz-, chrome/safari/opera:-webkit-, ie:-ms-, and of course many versions of ie are not accepted, therefore, you can use a filter to process it.
Focus on the ie filter effect:
Filter: alpha (opacity = 100 finishopacity = 50 style = 1 startx = 0, starty = 0, finishx = 0, finishy = 150) progid: DXImageTransform. microsoft. gradient (startcolorstr = # ffffff, endcolorstr = #000000, gradientType = 0 );
-Ms-filter: alpha (opacity = 100 finishopacity = 50 style = 1 startx = 0, starty = 0, finishx = 0, finishy = 150) progid: DXImageTransform. microsoft. gradient (startcolorstr = # ffffff, endcolorstr = #000000, gradientType = 0 );

Style = 0: uniform shape; style = 1: Linear; style = 2: radial; style = 3: rectangle;
Startx/starty/finishx/finishy: coordinates of the start and end points;
Gradient = 1: horizontal gradient; gradient = 0: vertical gradient.

-Webkit-linear-gradient (top, # ffffff, #000000 );
Linear: Gradient Type
Top: Start Point
# Ffffff: start color
#000000: End color
Supported browsers: Webkit (-webkit-), Gecko (-moz-), presto (-o-), Trident (-ms -)
Direction:
In the above text, 'top' is the starting point and also contains 'to bottom'
<Angle>: 0deg indicates the direction from left to right, And 90deg indicates the direction from bottom to top. It can be expressed as a negative value, in the opposite direction as a positive value.
Top class: Give the starting direction. You only need to add two attributes in both directions, such as left top.

Ps: other browsers that do not meet these changes are still relatively small. In this case, you can define an appropriate over-color representation using the most basic background: # red.

-- Lankongclub

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.