IE7有问题,这里是解释。
HTML
<a class="item" href="http://google.com">
<div class="itemImg">
<img src="http://img-fotki.yandex.ru/get/4512/vmazann.0/0_52db2_1c3135a9_orig.jpg" alt=""/>
</div>
<h3>Hello World</h3>
</a>
CSS
.item {
color: #140804;
cursor: pointer;
padding: 17px;
position: relative;
text-align: center;
text-decoration: none;
width: 142px;
display:block;}
.item * {
cursor: pointer;}
.itemImg {
background: none repeat scroll 0 0 red;
height: 150px;
line-height: 150px;
margin-bottom: 10px;
overflow: hidden;
text-align: center;
vertical-align: middle;}
.itemImg img {
vertical-align: middle;}
结果
问题
在 IE7 中图片无法点击
我对问题的看法
似乎该问题与 .itemImg 上的 hasLayout 属性设置有关。如果我删除触发 hasLayout (height: 150px; and overflow: hidden;) 的属性,那么图像将是可点击的
问题
有没有办法解决这个问题?高度:150px;和溢出:隐藏;是必需的属性。