码迷,mamicode.com
首页 > Web开发 > 详细

I do not want to inherit the child opacity from the parent in CSS(不想让子元素继承父元素的透明度)

时间:2015-12-25 13:08:58      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:

Instead of using opacity, set a background-color with rgba, where ‘a‘ is the level of transparency.

So instead of:

background-color: rgb(0,0,255); opacity: 0.5;

use

background-color: rgba(0,0,255,0.5);

I do not want to inherit the child opacity from the parent in CSS(不想让子元素继承父元素的透明度)

标签:

原文地址:http://www.cnblogs.com/voctrals/p/5075374.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!