【发布时间】:2014-10-04 01:27:04
【问题描述】:
下面是一个简单的 html 文件,包含一个锚点,由具有特定样式的块元素覆盖。应用样式后,该链接仅在 IE9 中不可点击。应用的样式是使锚点静音但允许用户在需要时单击。使用 Jquery 尝试了不同的选项,但没有成功。在 html/css 中对此有何 hack?
<!DOCTYPE html>
<html>
<head>
<title>Trial</title>
<style>
.overlay {
display: block;
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(255,255,255,.4);
pointer-events: none;
}
</style>
</head>
<body>
<div class="overlay"></div>
<a href="http://www.google.com" target="_blank">ClickMe</a>
</body>
</html>
【问题讨论】:
-
在 IE9 中使用
pointer-events: none;会取消点击(指针)事件 -
删除pointer-events属性后是否有效?
-
@EricHolmes 错了。
pointer-events:none"instructs the mouse event to go "through" the element and target whatever is "underneath" that element instead."
标签: html css internet-explorer internet-explorer-9