Walkthrough CSS Filters (4) Chroma Properties

Source: Internet
Author: User
Tags filter expression transparent color
css| Filter | Detailed Chroma property You can set the color specified in an object as a transparent color, and its expression is as follows:

  Filter:chroma (Color=color)

The expression of this property is not simple, it has only one argument. Just use the color parameter to set the colors you want to specify to be transparent. For example, the following picture:

The figure shows two fonts, two colors, and we now add the Chroma property to the "leaves" font to make it transparent. The code is as follows:

  <title>chroma filter</title>
<style>
<!--
div{position:absolute;top:70;width:200;
Filter:chroma (Color=green)}
   //* defines a div-wide green as a transparent color, and sets the position of the div in addition *//
   P{font-family:bailey;font-size:48;font-weight:bold;
Color:green} //* set P's font name, size, weight, color *//
   Em{font-family:lucida handwriting italic;font-size:48;
Font-weight:bold;color:rgb (255,51,153)}
   //* Sets the font name, size, weight, and color of EM *//
   -->
</style>
<body>
<div>
<p>leaves <em>LOVE</em></p>
</div>
</body>

Make the green transparent by setting the Chroma property in the code above. The display effect is as follows:

We see the green leaves font is missing, in fact it is transparent, in IE click on its area, it will still show (see figure below):

Also, it is important to note that the Chroma property is not suitable for picture files. Because many of the pictures are subtractive and compressed (such as JPG, GIF, etc.), they rarely have a fixed position to be set to transparent.



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.