I am writing a webpage with a fixed footer on the bottom of the page. The content of the page has a specific width and is centered. The footer also has a specific width and must be centered.
Issues:
postiton: fixed
- footer is not centeredz-index
hardly fixes it because I have a gradient on the background set like a body background.So I would need something like float: bottom
....
Although the other answers do work, you should avoid using negative margins.
Try this:
.footerholder {
background: none repeat scroll 0 0 transparent;
bottom: 0;
position: fixed;
text-align: center;
width: 100%;
}
.footer {
background: none repeat scroll 0 0 blue;
height: 100px;
margin: auto;
width: 400px;
}
And the HTML would be:
<div class="footerholder">
<div class="footer">
....
</div>
</div>
---------- Edit ------------
You should also ammend your over all page size, as to take into consideration the height of your footer - otherwise you will never see the bottom content