How CSS implements transparent and opaque images (full code)

Source: Internet
Author: User
This article gives you the content is about how CSS to achieve the transparency and opacity of the image (complete code), there is a certain reference value, the need for friends can refer to, I hope to help you.

1. Image transparency opaque to the opacity element, with a value of 0 to 1, usually 0.4 or 0.6 is enough.

2.IE8 The following browsers are written as: Filter:alpha (opacity=40), with a value of 0 to 100. Generally write both at the same time for compatibility.

3. There are two types of use, the first direct write on the image to increase the degree of ambiguity (equivalent to the gray mask); the second picture is written in the background p, nested p write a mask with color, the inside can also add text. The specific wording is as follows:

<! DOCTYPE html>

Operating effect:

Attention:

1. Pseudo-Class: hover You can set the transparency when the mouse moves to the picture.

2.div Write background image The default height is 0, be sure to limit the height to display the full size of the picture.

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.