How to solve the inheritance problem of opacity transparency property in CSS3

Source: Internet
Author: User

Using CSS3 's transparent properties opacity can animate the fade fade of objects, but in many cases this single fade fade effect does not meet our daily development needs. Sometimes we need to add a subset object to the object that sets the Opacity property to meet our requirements. But CSS3 's opacity (eg: opacity:0.5;) The transparency property is inherited, and its subset elements have a transparency effect when the opacity transparency property is set on an object.

The background color of RGBA can be used to set the transparency effect of an object very directly, and there is no inheritance for its subset elements, whereas an object that uses the RGB color and sets the opacity transparency property produces transparency inheritance.

一般不想要继承的情况下用rgba 的效果很好 background:rgba(0,0,0,.5) ;

How to solve the inheritance problem of opacity transparency property in CSS3

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.