【发布时间】:2020-06-18 18:51:50
【问题描述】:
我需要一个在屏幕上始终可见的页脚,除非打开虚拟键盘。这是 iOS 上的默认行为,但在 Android 上,页脚位于键盘上方。这可以防止吗?
<div class="cont">
<input />
<input />
<!-- Lots more inputs -->
</div>
<p class="footer">Footer</p>
.cont {
display: flex;
flex-direction: column;
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: blue;
color: white;
text-align: center;
height: 50px;
line-height: 50px;
}
https://codepen.io/adsfdsfhdsafkhdsafjkdhafskjds/pen/qBbROeG
【问题讨论】: