IE的a的bug
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
*{margin:0;padding:0;}
a{
position:absolute;
top:0;
left:0;
width:157px;
height:156px;
text-decoration:none;
z-index:10;
border:1px solid ;
}
img{
position:absolute;
z-index:1;
}
</style>
</head>
<body>
<div style="position:relative;margin:100px auto;width:500px;height:200px;border:1px solid;">
<img src="http://photo2.bababian.com/upload1/20091028/54FB5831021B1353B51B2BB441B9AEDB_75.jpg" alt="" />
<a href="http://www.sina.com.cn"></a>
</div>
</body>
</html>
在IE下:a无论怎么设置都不能覆盖img,在img范围内,没有链接。
将img换成div标签也是一样,如下代码:
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
*{margin:0;padding:0;}
.wrap{
position:relative;
height:100px;
border:1px solid red;
}
.wrap a{
position:absolute;
width:200px;
height:200px;
top:0;
left:0;
border:1px solid #ccc;
}
</style>
</head>
<body>
<div class="wrap">
<div class="box">5555555555555555</div>
<a href="http://www.sina.com.cn"> </a>
</div>
</body>
</html>
最后的解决办法:给a加了个1px的透明背景(真无语啊!—_—|)。