html - 页脚在不同的浏览器中采用不同的尺寸

标签 html css footer sticky-footer

我正在构建一个网络应用程序。

我在页面上添加了一个页脚。

页脚在 Firefox 中变大(横向)。有什么可能的原因吗?

页脚是此处提到的粘性 div - http://ryanfait.com/resources/footer-stick-to-bottom-of-page/

容器 CSS -

.container{

    background: #ffffff;
    width: 90%;
    min-height: 100%;
            height: auto !important;
            height: 100%;

    background: #FFF;
    margin: 0 auto -60px;
    max-width: 1200px;/* a max-width may be desirable to keep this layout from getting too wide on a large monitor. This keeps line length more readable. IE6 does not respect this declaration. */
    min-width: 768px;/* a min-width may be desirable to keep this layout from getting too narrow. This keeps line length more readable in the side columns. IE6 does not respect this declaration. */

}

页脚 CSS -

#footer {
        height: 60px;

        background-color: #F0F0F0  ;

    width: 90%;
    margin: 0 auto 0;

    -moz-border-radius: 2px;
    border-radius: 2px;
        }

最佳答案

从容器元素开始,只需添加页脚元素的这两个属性

#footer
{
max-width: 1200px;
min-width: 768px;
}

关于html - 页脚在不同的浏览器中采用不同的尺寸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15306974/

相关文章:

javascript - 使用向上和向下箭头导航不起作用

html - 按钮内部的轮廓

javascript - 如何将 javascript 选取框增加到网站的大小?

jquery - 在滚动条上隐藏导航栏 - 平板电脑

jquery - 他们如何将页脚固定在底部,而页面在顶部滚动?

c# - 非粘性页脚 CSS 帮助?

css - 新的 "hidden footer"有效,但仍然与屏幕底部的内容重叠

html - 将鼠标悬停在 IE9 中带有边框半径的 png 上,会弄乱透明度

html - 两人如何在 Azure 上为同一域设置三个应用服务

javascript - 如何通过 getElementById 替换所有div的innerHTML