我创建了一个包含可点击文本的框列表,但是 IE 将文本设置在链接上方,因此当将鼠标悬停在文本上时,它会优先考虑它使链接不再起作用。Chrome + Firefox 按预期工作。
如果可能的话,我还想看看是否可以在不使用 javascript 或 jQuery 的情况下进行修复。我还需要它来支持 IE8+。
这是jsfiddle。
HTML:
<!DOCTYPE html>
<html>
<body>
<ul class="container">
<li class="optionBox"> <i class="reporting"></i>
<a href="#">Lorem ipsum dolor sit amet.</a>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur lobortis
tortor egestas massa dignissim eu auctor turpis rutrum. Morbi suscipit
dictum lacinia.</p>
</li>
<li class="optionBox"> <i class="reporting"></i>
<a href="#">Lorem ipsum dolor sit amet.</a>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur lobortis
tortor egestas massa dignissim eu auctor turpis rutrum. Morbi suscipit
dictum lacinia.</p>
</li>
<li class="optionBox"> <i class="reporting"></i>
<a href="#">Lorem ipsum dolor sit amet.</a>
<p>CLorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur lobortis
tortor egestas massa dignissim eu auctor turpis rutrum. Morbi suscipit
dictum lacinia.</p>
</li>
<li class="optionBox"> <i class="reporting"></i>
<a href="#">Lorem ipsum dolor sit amet.</a>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur lobortis
tortor egestas massa dignissim eu auctor turpis rutrum. Morbi suscipit
dictum lacinia.</p>
</li>
<li class="optionBox"> <i class="reporting"></i>
<a href="#">Lorem ipsum dolor sit amet.</a>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur lobortis
tortor egestas massa dignissim eu auctor turpis rutrum. Morbi suscipit
dictum lacinia.</p>
</li>
<li class="optionBox"> <i class="reporting"></i>
<a href="#">Lorem ipsum dolor sit amet.</a>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur lobortis
tortor egestas massa dignissim eu auctor turpis rutrum. Morbi suscipit
dictum lacinia.</p>
</li>
<li class="optionBox"> <i class="reporting"></i>
<a href="#">Lorem ipsum dolor sit amet.</a>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur lobortis
tortor egestas massa dignissim eu auctor turpis rutrum. Morbi suscipit
dictum lacinia.</p>
</li>
<li class="optionBox"> <i class="reporting"></i>
<a href="#">Lorem ipsum dolor sit amet.</a>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur lobortis
tortor egestas massa dignissim eu auctor turpis rutrum. Morbi suscipit
dictum lacinia.</p>
</li>
</ul>
</body>
</html>
CSS:
.container {
overflow: hidden;
width: 1000px;
list-style: none;
margin: 15px;
padding: 0;
}
.optionBox {
float: left;
overflow: hidden;
width: 400px;
height: 125px;
cursor: pointer;
margin: 0.3em;
padding: 0.5em 0.5em 2em 0.5em;
color: #555;
background: transparent;
border: solid 1px #DDD;
-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, .1);
-moz-box-shadow: 0 0 4px rgba(0, 0, 0, .1);
box-shadow: 0 0 4px rgba(0, 0, 0, .1);
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.reporting {
position: absolute;
background:url('http://s13.postimage.org/w73u674ur/icon.png') no-repeat;
float: left;
width:30px;
height:30px;
}
a {
position: absolute;
width: 340px;
height: 115px;
font-size: 1.2em;
padding-left: 3.8em;
color: #08C;
text-decoration: none;
}
a:hover{
text-decoration:underline;
}
p {
font-size: 1.2em;
margin: 1.6em 0 0 3.8em;
}
body {
font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 12px;
line-height: 20px;
color: #333;
}