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.