Android : style a div to have the same background color after scrolling

on Friday, October 31, 2014


My Android phonegap application has one scrollable div as below:


HTML



<div data-role="page" id="home">
<div data-role="content" id="mContent" >


CSS



div#home{
position: relative;
background-color: #EFEFEF;
overflow: scroll;
margin: 0;
padding: 0;
min-height:100%;
}

div#mContent{
width: 100%;
overflow:scroll;
margin: 0;
padding: 0;
background-color: #EFEFEF;
min-height:100%;
display: inline-block;
}


My problem is that the background color (only on some device) is present only for the height which is initially displayed but when I scroll the rest gets black.


I tried with all the solution proposed in this similar SO post (in my case, using min-height) but noone of them helped.


Before scrolling


enter image description here


After scrolling a bit (the more you scroll the more you get a dark background)


enter image description here


0 comments:

Post a Comment