This is with respect to a mobile page in jquery mobile
I have 2 divs as follows within a parent div(data-role=header)
<div data-role="header">
<div class="inner-topHeader-panel"></div>
<div class="inner-centercontent"></div>
</div>
I want "inner-topHeader-panel" to be a fixed in position(note: it is of variable height) and "inner-centercontent" to be placed below "inner-topHeader-panel" and be scrollable. When scrolled, parts of it that is scrolled up should be hidden behind the "inner-topHeader-panel" div.
Current CSS is as follows.
.inner-topHeader-panel{
width:100%;
height:auto;
margin:0;
background:#fff;
border-bottom:none;
float:left;
position:fixed !important;
top:0;
}
.inner-centercontent{
width:100%;
float:left;
padding-bottom: 50px;
}
solution: Thanks @LessQuesar,@ezanker and @mainguy, I set second div's css as follows and it worked!
.inner-centercontent{
width:100%;
height:100px;
overflow: hidden;
overflow-y: auto;
float:left;
position:fixed !important;
padding-bottom: 50px;
}
and i set the .inner-centercontent's top position using jQuery according to the height of .inner-topHeader-panel