17
可能重复:
Passing mouse clicks through an overlaying element <div>点击链接
是否可以单击红色方块下面的链接,而不JavaScript的?红色的div不需要点击。
http://jsfiddle.net/efortis/LNwHV/
#bottom{
width: 100px;
height: 100px;
background-color: orange;
}
#top{
width: 50px;
height: 50px;
position: absolute;
left:0;
top:0;
background-color: rgba(255,0,0,.5);
}
谢谢!这很好。 –
然后它不是一个解决方案。 甚至不能在IE10中工作。 – wouterds
@WouterDS:是的,它甚至在IE10中无法正常工作。不幸的是,这都是CSS所能提供的。如果您需要支持IE,您可能必须使用JavaScript,就像我答案中的最后一个链接一样。 – thirtydot