#2
xq宁静致远2010-08-02 15:56
|
程序代码:
<style type="text/css">
<!--
.thumbnail{position:relative;z-index:0;}
.thumbnail:hover{background-color:transparent;z-index:50;}
.thumbnail span{position:absolute;background-color:#FFFFE0;left:-1000px;border:1px dashed gray;visibility:hidden;color:#000;text-decoration:none;padding:5px;}
.thumbnail span img{border-width:0;padding:2px;}
.thumbnail:hover span{visibility:visible;top:-30px;left:60px;}
p{margin-top:200px}
-->
</style>
<p><a class="thumbnail" href="#">文字<span><img src="http://gg. /></span></a></p>
现在的代码是图片显示离顶端-30px,离左端是60px,我现在想要离左端是根据文字长度,让图片显示的时候最靠近此段最右边的文字,代码怎么改啊 ,谢谢啦 <!--
.thumbnail{position:relative;z-index:0;}
.thumbnail:hover{background-color:transparent;z-index:50;}
.thumbnail span{position:absolute;background-color:#FFFFE0;left:-1000px;border:1px dashed gray;visibility:hidden;color:#000;text-decoration:none;padding:5px;}
.thumbnail span img{border-width:0;padding:2px;}
.thumbnail:hover span{visibility:visible;top:-30px;left:60px;}
p{margin-top:200px}
-->
</style>
<p><a class="thumbnail" href="#">文字<span><img src="http://gg. /></span></a></p>