如何使图像无论屏幕高度/宽度如何都停留在屏幕底部
How do I make an image stay at the bottom of the screen no matter the screen height/width?
我试图在屏幕右下角滚动文本时显示图像。我如何为所有屏幕宽度和高度找到它?
您可以在图像上使用固定位置,并分配左侧,顶部,右侧或底部属性以满足您的需求,请参阅:http://www.w3schools.com/css/css_positioning.asp 示例
这将起作用:
<style type="text/css">
img.floating {
position: absolute;
bottom: 0px;
left: 0px;
}
</style>
<img class="floating" src="url to image" />
: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" />
为 :将鼠标悬停在文本上创建 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">
相关文章:
- HTML导航在屏幕底部,并粘贴到顶部
- Element赢得'当我动态更改底部属性时,t锚定到屏幕底部
- 一页签出滚动到下一页的屏幕底部
- Firefox加载底部屏幕从未停止
- 屏幕底部的 Div
- 粘性页脚始终位于屏幕底部(不是网页)
- 如何滚动以在屏幕底部设置 DIV 的底部(监视器)
- 页脚仅粘在屏幕底部而不是内容
- 如何使图像无论屏幕高度/宽度如何都停留在屏幕底部
- jQuery或JS,使元素离开屏幕底部并在顶部输入
- 如何放置填充整个屏幕但在底部某个位置停止的背景图像
- 修复了滚动时的顶部菜单't允许到达屏幕'底部
- 如何创建一个固定在屏幕底部的页脚,但当用户向下滚动时,它不再是固定的页脚
- 如何找出屏幕底部和最底部HTML内容之间的间隙
- Venobox在屏幕底部部分显示图像
- 垂直可调整大小的面板固定在屏幕底部
- 将屏幕一侧的元素扩展到屏幕底部
- jQuery ScrollTop"禁用“;当点击屏幕底部时
- 如何在页面上设置#链接,但将目标与屏幕底部对齐
- 粘性页脚在较大设备上不粘在屏幕底部 - 引导