aal*_*aap 5 html css xhtml cross-browser
我在这里有一个非常简单的启动页面:http://iph0wnz.com
它的主图形位于中间,其次是我的'a'.右下方的徽标.我希望该徽标与整个页面的右下角对齐,这意味着如果页面中有很多文本内容,它会显示在所有内容之后(即它不会悬停在顶部),但是如果内容较少 - 就像现在一样 - 然后它应该与屏幕的最底部对齐,而不是在内容之后.
我将尝试给出一个文本示例,就像我在如何将div的内容对齐到底部一样?:
-----------------------------
| less content, no scroll |
| |
| |
| |
| a. |
----------------------------- (screen height)
和
-----------------------------
| more content, yes scroll |
| the quick brown fox jump- |
| ped over the lazy dog an- |
| d she sells sea shells on |
| the sea shore and some o- |
| ther random text is put | (screen height)
| here so there is a scroll |
| bar because the content |
| is too much for one scre- |
| en to show. okay, I think |
| that is enough. |
| a. |
-----------------------------
除了上面链接的其他问题,我还看了如何强制DIV块扩展到页面底部,即使它没有内容?但这对我也没有用.
我知道这很简单,但我只是厌倦了尝试我能找到的所有黑客和技巧.
此外,当实际内容进入时,我想使用该方法将徽标放在网站上 - 它将成为一个博客.
注意:如果需要实现此效果,我不介意使用JavaScript和jQuery.
尝试此解决方案:
* { margin: 0; }
html, body { height: 100%; }
/* the bottom margin is the negative value of the footer's height */
.wrapper { min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -142px; }
/* .push must be the same height as .footer */
.footer, .push { height: 142px; }
Run Code Online (Sandbox Code Playgroud)
在这里找到
编辑:为时已晚,无法记住如何操作或解释它,但如果您需要更多帮助搜索谷歌"粘性页脚"