我正在使用 Bootstrap 和 backstretch ( http://srobbin.com/jquery-plugins/backstretch/ ) 来组合一个简单的静态网站。在不同的浏览器上测试它时,我发现它无法在 Safari 上正确加载。我知道我的一些代码不是很干净,因为这是一项正在进行的工作,但内容在其他浏览器上显示完美,所以我很难过。
通常,这会呈现一个 div,它是页面的全宽和视口高度的 95%。然后,这个 div 被一个使用 backstretch 的图像填充。在 safari 的情况下,根本不显示图像,并且文本与下一组 html 重叠。
<div class="row" style=" height:95vh; position: relative;" id="frontpage" >
<div class="col-lg-offset-2 col-lg-8 col-md-offset-2 col-md-8 col-sm-offset-1 col-sm-10 text-center " style="position: absolute; top: 67%;">
<h1 style="color:white; " id="title">
Just Some Title Text </h1>
<h4 style=" color:#D5D5D5; float:none; " id="tagline">
This is my secondary text. </h4>
</div>
</div>
<script> $("#frontpage").backstretch("img/FP2D.jpg");</script>