Reputation:
I have a page into my site where I want that the footer stay on the bottom of the page when I scroll down the page the footer is every time on the bottom of the page. And now when I scroll down the footer remain at the same position and don't go on the bottom of the page I don't know if the problem is the backstretch plugin maked in jquery but this is my code:
<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ù!!<br />
Una caldaia periodicamente controllata è 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;
}
Upvotes: 0
Views: 172
Reputation: 18530
This is a common problem. Here is a nice, well-known, cross-browser solution:
Make the Footer Stick to the Bottom of a Page
Upvotes: 2