html - 页面底部的页脚

标签 html css

我的站点中有一个页面,当我向下滚动页面时,我希望页脚始终位于页面底部,页脚每次都位于页面底部。 现在,当我向下滚动时,页脚保持在同一位置并且不会位于页面底部 我不知道问题是否出在 jquery 中制作的 backstretch 插件,但这是我的代码:

<title>Atec Clima</title>
<script>
    $.backstretch("img/bg.jpg",{speed: 500});
</script>
</head>
<body>

<div class="container">
    <?php require("_header.php");?>
    <div class="page">
        <div class="riquadri">
            <img src="img/home/riscaldamento.jpg" alt="riscaldamento" />
            <p>
                Una caldaia ben mantenuta consuma meno… risparmia energia e dura di pi&ugrave;!!<br />
Una  caldaia periodicamente controllata &egrave; garanzia di sicurezza per l’utente e per l’ambiente. 
            <title>Atec Clima</title>
<script>
    $.backstretch("img/bg.jpg",{speed: 500});
</script>
</head>
<body>

<div class="container">
    <?php require("_header.php");?>
    <div class="page">


    </div>

</div>
    <div class="footer">
    </div>
</body>
</html>

body  {
    font-family: UbuntuRegular;
    font-size: 62.8%;
    width: 100%;
    height: 100%;
    background: #fff url(../img/bg.jpg) top center no-repeat;
}
.container {
    width: 1000px; 
    height:100%;
    margin: 0 auto -140px;
    overflow: hidden;
    top: 0;
    bottom: 0;
    left: 0; 
    z-index: 2;
    padding-bottom:140px;
}

.footer{
    background:#1357c6;
    position:absolute;
    bottom:0;
    width:100%;
    height:140px;
}

最佳答案

这是一个常见问题。这是一个不错的、众所周知的跨浏览器解决方案:

Make the Footer Stick to the Bottom of a Page

关于html - 页面底部的页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11762840/

相关文章:

html - 视频源类型标签是可选的吗?如果是我应该将 src 内联而不是嵌套吗?

php - 提交表单后保持选择的值

HTML 定位问题

css - 使用 SCSS 添加多个类的样式?

CSS 定位不起作用,我做错了什么?

javascript - 为什么在 Chrome 中添加跨度会改变字母位置或宽度?

html - 这个空间从哪里来?

php - 如何使用php将HTML代码插入数据库

javascript - 如果传递了 DateTime 变量,则使用 Javascript 更改 Div 类

android - 如何使用 ListView BELOW LinearLayout