IOS底部fixed位置決めの失効問題を解決する
1172 ワード
解決策:fixedで位置決めされた要素と、スクロールされた要素を分けて、階層、頭部、底部を混ぜないで、以下のようにします.
html
css
html
css
.header,.footer,.main {
display: block;
}
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 100px;
}
.footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 30px;
}
.main {
/*main , */
position: absolute;
/*top */
top: 100px;
/*bottom */
bottom: 30px;
/* */
overflow-y: scroll;
/* , */
-webkit-overflow-scrolling: touch;
}
.main .content {
height: 2000px;
}