Layout One: Define the overall height of the page as 100%, then use the Position:absolute layout to resolve
<body>
<div class= "Wrap" >
<div class= "Header" >header</div>
<div class= "Main" >
Elastic scrolling Area
</div>
<div class= "Footer" >footer</div>
</div>
</body>
html,body{height:100%;}
. wrap{width:100%;}
. Header,.footer{height:40px;line-height:40px;background-color: #D8D8D8; text-align:center;}
. header{position:absolute;top:0;left:0;width:100%;}
. footer{position:absolute;bottom:0;left:0;width:100%;}
. main{
Position:absolute;
Z-index:1;
top:40px;
left:0;
bottom:40px;
width:100%;
}
Layout Two: Define the overall height of the page as 100%, then use the Display:flex layout to solve
<body>
<div class= "Wrap" >
<div class= "Header" >header</div>
<div class= "Main" >
Elastic scrolling Area
</div>
<div class= "Footer" >footer</div>
</div>
</body>
html,body{height:100%;}
. wrap{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;- webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;width:100%;height:100%;}
. Header,.footer{height:40px;line-height:40px;background-color: #D8D8D8; text-align:center;}
. main{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:100%;}
Then the main problem is that the child container height exceeds the height of the parent container and how the content of the child container scrolls.
. css{
overflow:auto;/* Winphone8 and android4+ * *
-webkit-overflow-scrolling:touch; /* ios5+ */
}
Mobile End elasticity Effect