How to filter text with CSS Filters

Source: Internet
Author: User

A friend who uses CSS Filters may encounter the following problem: Set the divFilter: alpha (opacity = 50 );The text in the filter is translucent. What should we do in this case?

After reading a large amount of materials, I finally found a method compatible with the css transparent filters of ie6, ie7, ie8, and firefox N times. Let me give an example.

Html code:

<Div id = "body">
<Span> <longge blog> solves the problem of CSS Filter filtering text at the same time </span>
</Div>

Css code:

<Style type = "text/css">
# Body {border: 1px solid # c00; background-color: rgba (0.5, 0,); background: # f00 \ 9; filter: alpha (opacity = 10 ); width: 500px; margin: 40px auto; line-height: 200%; font-size: 14px; padding: 14px ;}
</Style>

Such code does not solve the problem of text filtering. to filter text, you must add this line of code to the CSS code:

# Body * {position: relative ;}

The asterisk is used to allow IE6 and IE7 to be executed. Firefox and IE8 will not be executed. Firefox itself does not support the filter function unique to IE, so there is no need to add an asterisk here. How can this problem be solved? Easy ~

Address: http://www.52blogger.com/archives/532

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.