我有一些CSS悬停问题,我做错了什么?CSS悬停不能正常工作
我试图实现,当我把鼠标悬停在图像上,透明div与其中的链接覆盖它,所以你可以点击它,并转到另一个页面。 类似于此页面上的东西http://sputniknews.com/当鼠标悬停在新闻上时
当我将鼠标悬停在图片上时,标记已停用并且悬停显示不正确。 与此滞留改变代码很多次了,不知道该怎么办
.cvr:hover {
background-color: rgba(0, 0, 0, 0.600);
height: inherit;
width: inherit;
float: left;
position: absolute;
left: 0px;
top: 0px;
visibility: visible;
}
.link {
word-break: normal;
word-wrap: break-word;
display: block;
height: inherit;
width: inherit;
text-align: center;
text-decoration: none;
color: aliceblue;
visibility: hidden;
}
.cvr:hover>.link {
visibility: visible;
}
.img {
width: inherit;
height: inherit;
}
.clear {
clear: both;
}
<div class="person">
<img class="img" src="http://www.gene-quantification.de/logo-img-cz.png">
<div class="cvr">
<a class="link" href="#"> link text is here</a>
</div>
</div>
<div class="person">
<img class="img" src="http://www.gene-quantification.de/logo-img-cz.png">
<div class="cvr">
<a class="link" href="#"> link text is here</a>
</div>
</div>
<div class="clear"></div>