CSS implements background transparency, text opacity (compatible with various browsers), and css opacity

Source: Internet
Author: User

CSS implements background transparency, text opacity (compatible with various browsers), and css opacity

In FF/Chrome and other newer browsers, you can use the css attribute background-color rgba to easily achieve background transparency, while text remains opaque. The IE6/7/8 browser does not support rgba. It only uses the exclusive filter: Alpha of IE, but this write method also makes the text transparent, therefore, you can only set position: relative in the child node of the transparent container (except the text node) to not inherit the transparent filter of its parent element. The Code is as follows:

1 <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 

 

The above code is successfully tested in IE6.0 +/FF3.0 +/Opera10 +/Chrome/Safari.

 

 


How is the webpage background translucent and the words in the div opaque (compatible with all browsers)

Use the js framework. jquery and extjs are easy to implement. You will find more functions.


How can we make the divs translucent background layer automatically adapt to the height?

Remove the position: absolute; In the content. This is the absolute position.

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.