[英]Fixed element using flexbox gets repositioned on iPhone mobile Safari due to disappearing menu on scroll
这是一个非常小众的问题,但是我正在构建一个React应用程序,并有一个登陆页面,其中主要背景元素是<div>
,其position: fixed
, height: 100%
样式。 它在所有桌面浏览器上都能很好地工作,但是当我在iPhone上尝试使用时,滚动时内容突然向下移动-我很确定这是由于Safari底部的菜单栏消失了。 呈现高度为100%时,是否有任何方法可以“绕过”此Safari菜单栏? 这是我元素的样式。 要查看实际效果,请点击以下链接: https : //gwtcharlotte.herokuapp.com/
<div className="landing-container text-center">
<div style={this.styleOptions()}
className='landing-image'>
</div>
<div className={`landing-overlay ${this.state.imageLoaded}`}>
<div>
<h1>GUYS WITH TIES</h1>
<p className='m-w-container m-auto'>Bringing Charlotte together and improving our community through non-profit fundraising</p>
<a style={{opacity: (this.state.imageLoaded ? 1 : 0)}}
className={'btn btn-red btn-small landing-btn'}
onClick={() => this.smoothScroll()}>DISCOVER OUR EVENTS</a>
<div style={{width:'100%', height: 70}}/>
</div>
</div>
</div>
.landing-container{
display: block;
width: 100%;
position: fixed;
height: 100%;
min-height: 500px;
font-size: 24px;
z-index: 0;
}
.landing-overlay{
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
color: #fff;
background: linear-gradient(#29709c,#4e6c7b);
display: flex;
padding: 15px;
flex-direction: column;
justify-content: center;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.