CSS implements gradient compatibility with mainstream browsers

Source: Internet
Author: User

In some cases, the gradient does not need to be cut, and some new users may not know it. This article describes how to use CSS to achieve linear gradient and be compatible with IE6.

Under what circumstances do I need CSS to implement a gradient?

It is unnecessary to replace the background image with CSS. For example, in the background of this form, it is a linear gradient from # ffffff to # eeeeee.

In some cases, the user may perform the following operations:

Or this is a variable-height layout. At this time, it is ideal to use CSS to implement this linear gradient.

The Code is as follows:

1. gradual_ff_f2 {2 filter: progid: DXImageTransform. microsoft. gradient (startcolorstr = # ffffff, endcolorstr = # eeeeee, gradienttype = 0); 3 Background:-moz-linear-gradient (top, # ffffff, # eeeeee); 4 Background: -WebKit-gradient (linear, 0 0, 0 bottom, from (# ffffff), to (# eeeeee); 5 Background:-o-linear-gradient (top, # ffffff, # eeeeee); 6/* cannot be abbreviated, for example, # ffffff cannot be abbreviated as # fff, the reason is to be studied */7}

This method is only applicable to linear gradient, and does not support various gradient in PS (such as circular gradient). Of course, the premise is that it is compatible with various browsers, especially the IE series. You can use it when applicable.

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.