Reputation: 2481
I have this HTML:
<div class="page">
<div class="content">
<p>Lorem ipsum dolor sit amet...</p>
<p>Etiam condimentum lorem faucibus feugiat egestas...</p>
</div>
<div class="footer">
<p class="text-center">Sticky footer with centered text?</p>
</div>
</div>
And this CSS:
body {
background: #222;
margin: 0;
padding: 0;
}
p {
margin: 0 0 20px;
}
.page {
margin-left: 200px;
background: #fff;
min-height: 1200px;
padding: 20px 20px 0;
}
.footer {
position: fixed;
bottom: 0;
background: #eee;
width: 100%;
padding: 20px 20px 0;
margin: 0 -20px;
}
.text-center {
text-align: center;
}
Here's the jsFiddle (better than thousand words):
How do I center the sticky footer to white page (.page), given that problematic margin-left that's causing the unalignment?
Thanks in advance!
Upvotes: 0
Views: 99