CSS setting the background layer transparent method

Source: Internet
Author: User
CSS enables precise pixel-level control of the placement of elements in a Web page, supports almost all font-size styles, and has the ability to edit Web page objects and model styles. If you need to set the background of a layer in HTML to be transparent, how to set it? Here's a look at how to use CSS to set the transparency layer effect, which is compatible with all browsers.

The following is the specific code (the above effect is set to 0.8):

. transparent{    Filter:alpha (opacity=50);    -moz-opacity:0.5;    -khtml-opacity:0.5;     opacity:0.5;     }

Let's take a look at the effect:

Here are some additional instructions for the above CSS code:

opacity:0.5: This property is the standard property that currently sets the transparency in CSS. Available for most versions of browsers such as Firefox,safari and opera.

Filter:alpha (opacity=50); This property only supports IE browser.

-moz-opacity:0.5: This property is intended to be compatible with previous old Mozilla browsers, such as Netscape Navigator.

-khtml-opacity:0.5; This property is intended to be compatible with older versions of the Safari browser (1.x), which uses the rendering engine that is still known as KTHML, relative to the current webkit.

The above content is the CSS to set the transparency layer effect of the method, we hope to help.

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.