CSS for transparent background, text opaque, compatible with all browsers

Source: Internet
Author: User

There are 3 ways to implement a transparent CSS method, and the following is a 80% notation for opacity

    • The value of CSS3 's opacity:x,x is from 0 to 1, such as opacity:0.8
    • CSS3 Rgba (red, green, blue, alpha), alpha values from 0 to 1, such as Rgba (255,255,255,0.8)
    • IE exclusive filter filter:alpha (OPACITY=X), x value from 0 to 100, such as Filter:alpha (OPACITY=80)
CSS3 's Opacity

Compatibility: IE6, 7, 8 not supported, IE9 and above and standard browser support

instruction for use : set all descendant elements of the opacity element to be transparent with each other, generally used to adjust the overall opacity of the picture or module

Instructions for use: set the opacity of the color, which is generally used to adjust the opacity of background-color, color, Box-shadow, and so on.

Background-color: #000000;/* IE6 and partial IE7 kernel browser (such as QQ browser) color is overwritten */

Background-color:rgba (0,0,0,0.2); /* IE6 and parts of IE7 kernel browser (such as QQ browser) will read, but resolved to transparent */

Use RGBA in Background-color, standard browser, background transparent, text opaque

Very wonderful is, IE6 and part of the IE7 kernel browser (such as QQ browser) will read Rgba, after parsing the color is transparent, in fact, it should be null

IE exclusive filter filter:alpha (OPACITY=X)

Instructions for use: IE browser-specific, a lot of questions, this article to set background transparency for example, as follows:

    1. only supports IE6, 7, 8, 9, and is abolished in the IE10 version
    2. In IE6, 7, you need to activate the haslayout attribute of IE (for example: *zoom:1 or *overflow:hidden) and let it read Filter:alpha
    3. In IE6, 7, 8, the Filter:alpha element is set, the parent element is set Position:static (the default property), and its child elements are relative positioning, which makes the child elements opaque

CSS for transparent background, text opaque, compatible with all browsers

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.