[英]Issue with android mobile (100vh and position fixed footer bug)
Here's link to site. 这里是网站链接 。
Site doesn't have scroll (you can move by using arrows), body has overflow:hidden
. 网站没有滚动(可以使用箭头移动),正文已overflow:hidden
。
Body contains 3 blocks: .main-content
, .bottom1
and .footer
.main-content
包含3个块: .main-content
, .bottom1
和.footer
.main-content
has 100vh
. .main-content
具有100vh
。
.bottom1
and .footer
have position:fixed
both. .bottom1
和.footer
position:fixed
都position:fixed
。
.Footer
has bottom: 0
, .bottom1
has bottom: 80px
. .Footer
bottom: 0
, .bottom1
bottom: 80px
。
Desktop works just fine: height is 100vh
and other blocks are at the bottom. 桌面工作正常:高度为100vh
,其他块位于底部。 ios mobile browsers are also fine. ios移动浏览器也可以。 But android browsers have huge height (like 3x bigger than expected) and user has to scroll down to see footer . 但是android浏览器的高度很高(例如比预期大3倍),用户必须向下滚动才能看到footer 。 Does anybody know how to fix this issue? 有人知道如何解决此问题吗?
applying position:fixed;
申请position:fixed;
to .main-content
will fix the issue. 到.main-content
将解决此问题。
.main-content {
position: fixed;
left: 0;
width: 100%;
height: 100vh;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.