Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have footer always at the bottom of page?

My page doesn't contain a lot of information, so footer is displayed somewhere in the middle of the page. How can I have that always at the bottom?

like image 688
LA_ Avatar asked Sep 24 '11 07:09

LA_


3 Answers

jquery mobile approach - <div data-role="footer" data-position="fixed">

like image 83
LA_ Avatar answered Oct 13 '22 01:10

LA_


{
  potition: absolute;
  bottom: 0;
  width: 100%;
  height: some_height;
}
like image 30
Mircea Soaica Avatar answered Oct 13 '22 01:10

Mircea Soaica


This isn't a fixed position footer. The footer will be offscreen if the page content is taller than the screen. I think it looks better this way.

The body and .ui-page min-height and height are necessary to prevent the footer from jumping up and down during transitions.

Works with the latest JQM version as of now, 1.4.0

body,
.ui-page {
    min-height:100% !important;
    height:auto !important;
}

.ui-content {
    margin-bottom:42px; /* HEIGHT OF YOUR FOOTER */
}

.ui-footer {
    position:absolute !important;
    width:100%;
    bottom:0;
}
like image 42
ArcadeRenegade Avatar answered Oct 12 '22 23:10

ArcadeRenegade