Use the transparency in the css3 background gradient to set the background gradient of different colors. css3 transparency

Source: Internet
Author: User

Use the transparency in the css3 background gradient to set the background gradient of different colors. css3 transparency

To add transparency, we use the rgba () function to define color nodes. The last parameter in the rgba () function can be a value from 0 to 1, which defines the transparency of the color: 0 indicates completely transparent, and 1 indicates completely opaque. The percentage after rgba () indicates the position.

Code:

Background:-webkit-linear-gradient (top, rgba (255,255,255, 0.4) 0%, rgba (255,255,255, 0.2) 75%, rgba (255,255,255, 0) 98% ); /* Safari, Chrome */background:-o-linear-gradient (bottom, rgba (255,255,255, 0.4) 0%, rgba (255,255,255, 0.2) 75%, rgba (255,255,255, 0) 98%);/* Opera */background:-moz-linear-gradient (bottom, rgba (255,255,255, 0.4) 0%, rgba (255,255,255, 0.2) 75%, rgba (255,255,255, 0) 98%);/* Firefox */background: linear-gradient (to bottom, rgba (255,255,255, 0.4) 0%, rgba (255,255,255, 0.2) 75%, rgba (255,255,255, (0) 98%);/* standard syntax (must be placed at the end )*/

 

Note: Internet Explorer 9 and earlier versions do not support gradient.

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.