CSS3 Tutorial (8): CSS3 Transparency Guide

Source: Internet
Author: User
CSS3 Transparent ... Non-transparent ... Gradient... Call it whatever you want! Here are some guidelines for using CSS3 transparency and some examples.

In fact, this firefox has long ago supported, and IE has not supported!
Previous post: CSS3 tutorial (7): CSS3 embedded fonts
The "opacity" declaration is used to set the transparency of an element: layers, text, pictures, etc... An element with a opacity value of 1 is completely opaque, whereas a value of 0 is completely transparent and invisible. Any value between 1 and 0 indicates how transparent the element is.
Browser compatibility
Opacity is the best browser support for a CSS3 element ... Except ie!, of course. CSS3 Transparent (example 1: Layer)

The above transparency example uses the following style:

P.OPACITYL1 {background: #036; opacity:0.2; width:575px; height:20px;} p.opacityl2 {background: #036; opacity:0.4; width : 575px; height:20px; } p.opacityl3 {background: #036; opacity:0.6; width:575px; height:20px;} p.opacityl4 {background: #036; opacity:0.8; Widt h:575px; height:20px; } p.opacityl5 {background: #036; opacity:1.0; width:575px; height:20px;}

Browser support:

Firefox (3.05 ...)

Google Chrome (1.0.154 ...)

Google Chrome (2.0.156 ...)

Internet Explorer (IE7, IE8 RC1)

Opera (9.6 ...)

Safari (3.2.1 windows ...) CSS 3 Transparency (Example 2: Picture)

We can also use different transparency effects on the image, just like the example above. A cool app is to apply opacity to: hover, which implements a linked mouse effect.

img.opacity1 {opacity:0.25; width:150px; height:100px;} img.opacity2 {opacity:0.50; width:150px; height:100px;} img.op acity3 {opacity:0.75; width:150px; height:100px;}

Browser support:

Firefox (3.05 ...)

Google Chrome (1.0.154 ...)

Google Chrome (2.0.156 ...)

Internet Explorer (IE7, IE8 RC1)

Opera (9.6 ...)

Safari (3.2.1 windows ...)

The above is CSS3 Tutorial (8): CSS3 Transparency Guide content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

Related articles:

CSS set an element translucent

Example description of using RGBA to adjust transparency in CSS3

Implement CSS3 opacity complete code

  • Related Article

    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.