我尝试使用 text-indent 但这仅适用于第一行,如果我使用边距,则文本根本不显示,我还能如何让文本在悬停时显示?这是代码
HTML:
<img src="" width="270" height="182"/>
<figcaption>
<ul>
<div style="top:0px; left:0px;width=270 height=182">
<a href="">Title</a><BR>
<a href="">Item 1</a><BR>
<a href="">Item 2</a><BR>
<a href="">Item 3</a><BR>
<a href="">Item 4</a>
</div>
</ul>
</figcaption>
CSS:
.annotated{
position:relative;
}
.annotated img{
display:block;
}
.annotated ul{
list-style:none;
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
}
.annotated div{
display:block;
padding:0 5px;
width:270px;
line-height:15px;
position:absolute;
text-indent:-99999px;
cursor:default;
}
.annotated div:hover {
background:#fff;
background:rgba(255,255,255,0.75);
z-index:2;
width:260px;
text-indent:0;
-webkit-box-shadow:0 0 5px rgba(0,0,0,0.25);
-moz-box-shadow:0 0 5px rgba(0,0,0,0.25);
box-shadow:0 0 5px rgba(0,0,0,0.25);
}
这是一个小提琴