这是代码-其中的div和图像-悬停时会出现另一个带有文本的div。所以问题是 - 如何在这个 div (imgWrap) 或 (imgDescription) 上建立一个带有文本的链接?我希望整个 div 成为一个链接,但我所有的努力都以失败告终。谢谢
<style>
.wr{
border:1px solid #ccc;
margin:10px;
float:left;
}
.imgWrap {
position: relative;
height: 175px;
width: 250px;
}
.imgWrap img{
height: 175px;
width: 250px;
}
.imgDescription {
position: absolute;
padding:20px;
overflow:hidden;
top: 0;
bottom: 0;
left: 0;
right: 0;
height:100%;
line-height:14px;
background: rgba(29, 106, 154, 0.8);
color: #fff;
visibility: hidden;
opacity: 0;
-webkit-transition: opacity 500ms;
-moz-transition: opacity 500ms;
-o-transition: opacity 500ms;
transition: opacity 500ms;
}
.imgWrap:hover .imgDescription {
visibility: visible;
opacity: 1;
}
</style>
<div class="wr">
<div class="imgWrap">
<img src="somepic">
<p class="imgDescription">
<a href="" style="color:white;"><b>item_name</b></a>
<small style="display:block;padding:10px 0px;">item_text</small>
<small>item_date</small>
</p>
</div>
</div>