如何使一个区域不可单击CSS? [英] How do i make an area unclickable with CSS?

查看:419
本文介绍了如何使一个区域不可单击CSS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们假设如果我有包装的div包括一些链接和图像,
有任何方式,我可以立即停用它与CSS只有?

Let's say if I have wrapper div which includes some links and images, is there any way I can deactivate it at once with CSS only?

// after reviews of answers
我放弃了可以使用CSS的想法。
jQuery blockUI插件就像charm一样工作。
非常感谢。

// after review of answers I dropped the idea that can make it with CSS only. jQuery blockUI plug in works like charm. Thanks a lot.

推荐答案

如果要使用jQuery,可以使用blockUI插件轻松实现。 ...或者用CSS回答你的问题,你必须绝对定位div在你想要阻止的内容。

if you are going to use jQuery, you can easily accomplish this with the blockUI plugin. ...or to answer your question with CSS, you'll have to absolutely position the div over the content you wish to block. just make sure the absolutely positioned div comes after the content to be blocked for z-indexing purposes.

<div style="position:relative;width: 200px;height: 200px;background-color:green">
    <div>
        <a href="#">Content to be blocked.</a>
    </div>
    <div style="position: absolute;top:0;left:0;width: 200px;height:200px;background-color: blue;z-index:2;opacity:0.4;filter: alpha(opacity = 50)"></div>
</div>

对于所有的内联css对不起。你必须做一些不错的类。此外,这只是在firefox和IE7测试。

sorry for all the inline css. you'll have to make some nice classes. Also, this has only been tested in firefox and IE7.

这篇关于如何使一个区域不可单击CSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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