2012-04-16 115 views

回答

1

这会工作:

<style type="text/css"> 
    img.floating { 
    position: absolute; 
    bottom: 0px; 
    left: 0px; 
} 
</style> 
<img class="floating" src="url to image" /> 
3

你可以在图像上使用固定的位置,并指定左,上,右或底部的属性来满足您的需求,请参阅:http://www.w3schools.com/css/css_positioning.asp为例

+2

http://w3fools.com/ [MDN - 定位](https://developer.mozilla.org/en/CSS/position) – Andrew 2012-04-16 21:20:23

+0

感谢指针安德鲁,我不会在将来使用它们。 – heavysixer 2012-04-16 21:42:51

0

创建CSS样式:悬停在文本上。

<style type="text/css"> 
#bottom { display:none; } 
#text:hover #bottom { 
display:block; 
position:absolute; 
left:0; // how far from the left 
bottom:0; 
} 
</style> 
<div id="text>TEXT</div> 
<img src="bottomimage.jpg" id="bottom"> 
1

:hover,除非它被一个链路上使用不适合IE6工作。用这个。

<style type="text/css"> 
    #myFavoriteFooterImage { 
    bottom:0px; 
    right:0px; 
    position:fixed; 
    display:none; 
    } 
</style> 
<script type="javascript"> 
    document.getElementById("mousyTextFunTime").onmouseover = function(){ 
     document.getElementById("myFavoriteFooterImage").style.display = ""; 
    }; 
    document.getElementById("mousyTextFunTime").onmouseout = function(){ 
     document.getElementById("myFavoriteFooterImage").style.display = "none"; 
    }; 
</script> 

<div id="mousyTextFunTime">Text to mouse over</div> 
<img id="myFavoriteFooterImage" />