I am developing jQuery Mobile page in which my CSS is
.ui-content {
background: transparent url('./images/bg.jpg');
background-size : 100% 100%;
min-height: 100%;
color:#FFFFFF;
text-shadow:1px 1px 1px #000000;
}
but page displays like this
I don't want that empty space between content and footer content height till the footer
Update
I have noticed that
.ui-content
div doesn't fill the empty space 100%, it is still missing2px
. Those comes from fixed toolbars header and footer, as they havemargin-top: -1px
andmargin-bottom: -1px
respectively. (fiddle)It wasn't obvious before as both page div and footer have the same black
data-theme="b"
. I have changed.ui-page
'sbackground-color: red;
to show the difference.Therefore, to achieve best results, it's necessary to check whether toolbars are fixed. Below is the enhanced solution.
jQM >= 1.3
jQM <= 1.2
Since fixed toolbars in jQuery Mobile 1.2 and below don't get
-1
fortop
/bottom
, there is no need to do subtract1px
from toolbar's.outerHeight()
.(1) On Desktop browser page will scroll by 1px; however, On mobile device it doesn't. It's caused by
body
's height set to99.9%
and.ui-page
to100%
.will do it!