不透明css影响儿童元素 [英] Opacity css affecting children elements

查看:133
本文介绍了不透明css影响儿童元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在用户禁用javascript时实现错误消息。我为我当前的工作创建了一个jsfiddle。我有2个div层,一个覆盖整个页面,另一个顶部显示警告消息,但不透明度设置影响覆盖层也会影响警告消息。我试过使用以前的问题的技术,但我不能使它的工作。谁能帮助我?

I am trying to implement an error message when user has disabled javascript. I have created a jsfiddle for my current work. I have 2 div layers one covering the whole page and an another one on top of that to show the warning message, but the opacity settings affects for the cover layer affects the warning message also. I have tried using the techniques from previous questions but I could not make it work. Can anyone help me?

http://jsfiddle.net/ xcPcv /

推荐答案

只需移动 的褪色容器...

Just move the message outside of the faded container ...

From:

<div id="fadeMe">
    <div id="center">You have javascript disabled.</div>
</div>

To:

<div id="fadeMe">
</div>
<div id="center">You have javascript disabled.</div>

http://jsfiddle.net/xcPcv/7/

这篇关于不透明css影响儿童元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆