information

 Checkout

 Følg udviklingen ...

 Vær årvågen ...

 Tag chancer ...

"Vær altid parat til at udforske verdenen med dens omskiftende teknologiske udvikling"

Mere info...

"Et anderledes CMS system med uanede muligheder, som sætter kunden i centrum med maximal grad af fleksibilitet"

mail
Validering XHTML 1.0 Strict
og Css

 

Cookie popup in the bottom of page



Twitter Bootstrap sticky footer (without the pain)

Strangely enough, the sticky footer examples which I've seen for Twitter Bootstrap 3 seem to ignore the fact that there is now a class which takes all the pain away. It's called 'navbar-fixed-bottom', and it is usually used to create a bottom up navigation bar. However, if you add it to your footer code, it works better than any other sticky footer examples. Here's how it works:
Create a footer thus:
<footer class="navbar-default navbar-fixed-bottom">
      <div class="container">
        <p>Hello world!</p>
      </div>
</footer>
Then style it using CSS thus:
footer.navbar-default.navbar-fixed-bottom
 {
      background:red;
      color:white;
      padding:1em 0;
 }
 footer.navbar-default.navbar-fixed-bottom p
 {
      margin:0;
 }
Easy! Sticky footers all the way for me now. They're really useful for mobile web apps.