如何将文本粘贴到页面底部? [英] How to stick text to the bottom of the page?
本文介绍了如何将文本粘贴到页面底部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在页面的底部放一行All Rights Reserved ...。
我尝试使用绝对定位,但是当窗口调整到较小的高度时,这种方式无法按预期工作。
I would like to put a line "All Rights Reserved..." at the bottom of the page. I tried to use absolute positioning, but this does not work as expected when the window resized to smaller height.
我如何实现这个简单的目标? / p>
How can I achieve this simple goal ?
推荐答案
您可能希望将绝对对齐的div放入相对对齐的容器中 - 这样它仍然会包含在容器中浏览器窗口。
You might want to put the absolutely aligned div in a relatively aligned container - this way it will still be contained into the container rather than the browser window.
<div style="position: relative;background-color: blue; width: 600px; height: 800px;">
<div style="position: absolute; bottom: 5px; background-color: green">
TEST (C) 2010
</div>
</div>
这篇关于如何将文本粘贴到页面底部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文