我试图在图像上显示文本并且它可以正常工作,但是当我将鼠标移到文本上时,它会闪烁!悬停时在图像上显示文字
https://jsfiddle.net/6k2Lhaje/
HTML:
<a class="wrapper">
<img style="margin-top:50px;"
src="http://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2014/4/11/1397210130748/Spring-Lamb.-Image-shot-2-011.jpg"
alt="" /></a>
CSS:
div.title {
display: none;
position: relative;
text-align: center;
top: -170px;
}
a.wrapper:hover + div {
display: block;
}
<div class="title"><h1>TEXT HERE</h1></div>
请帮我解决这个问题..也许它更好地使用背景图片呢?
铬,当你去鼠标移到文本 –
它的确闪烁。我的坏 - 更新的答案给你一个实际的答案:) – Sk93