I am developing a mobile app using Cordova and I am trying to create a scrolling div that covers the entire page except for a top and bottom navbar. Here is an example on jsfiddle.
From what I have gathered, it seems like I need to specify the height of the div in order for it to scroll. Currently, at line 30 in the CSS file, the height property is commented out:
#long {
background: -webkit-linear-gradient(red, blue);
width: 90%;
/* scroll */
overflow-y: scroll;
/* for the navbar */
margin-top: 48px;
float: left;
/* to make the scroll work */
/*height: 347px;*/
-webkit-overflow-scrolling: touch;
}
I would rather not set a fixed height because using specific intervals for media queries could result in unintended margins on certain phone sizes.
Another factor to consider is that the app has multiple "pages" which are div elements moved out of the viewport when not in use but still in the document.
Do you have any ideas on how to solve this issue? Ideally, I would like a solution that only involves CSS.