浏览器底部的页脚(滚动时除外) [英] Footer at bottom of browser except when I scroll
问题描述
我遇到一个奇怪的页脚问题。
I'm having a weird footer issue.
如果我扩大或缩小页面底部的云将粘在浏览器窗口的底部窗户。但是,当我向下滚动时,页脚会在页面中间展开。在我的其他所有页面上,这都不是问题,因为在滚动条出现之前,它们都适合900x600的窗口。
The clouds at the bottom of the page will stick to the bottom of the browser window if I expand or shrink the window. BUT when I scroll down, the footer winds up in the middle of the page. This isn't a problem on any of my other pages because they all fit in a 900x600 window before a scroll bar appears.
有没有一种方法可以将我的页脚保持在窗口底部,即使我滚动时也是如此(这样它将始终位于内容下方)而不会弄乱所有代码其他共享CSS文档的页面?
Is there a way to keep my footer at the bottom of the window even when I scroll (so it would always there under the content) without messing up the code for all the other pages that share the CSS document?
推荐答案
在页脚CSS规则中将 position:absolute;更改为 position:已修复;'
In the footer CSS rule change 'position: absolute;' to 'position: fixed;'
您可能还需要使用其他一些def,但这是可行的。
you may also have to play with a few other def's but this works.
这是我的最终页脚规则
footer {
position: fixed;
color: black;
width: 100%;
height: 4.6em;
background-image: url(http://img.photobucket.com/albums/v410/justice4all_quiet/bottom_clouds.jpg);
background-repeat: repeat-x;
background-color: e0e0e0;
z-index: -999;
overflow: hidden;
bottom: 0px;
}
这篇关于浏览器底部的页脚(滚动时除外)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!