【发布时间】:2017-07-04 07:50:49
【问题描述】:
如何让背景图片在 iPhone 上显示与在 Android 上显示一样?
HTML
<div class="bgimg-1">
<div class="hometoptext ">
<h1 class="text-center">
Africa's First Online Business Lender
</h1>
<div>
<h3 class="thin">Grow faster with South Africa's most innovative online funder</h3>
</div>
<div class="text-center">
<button class="btn btn-primary" (click)="applyNow()">APPLY NOW</button>
</div>
</div>
<div class="bottom-arrow text-center">
</div>
</div>
背景图片不显示在 iPhone 上
CSS
.bgimg-1 {
background-image: url("img/main_pic2.png");
color: white;
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-color: #999;
position:relative;
width:100%;
min-height: 100vh;
top: 0;
}
Android 上的图片:
iPhone 上的图片:
【问题讨论】:
-
它与 Android 有什么关系?
-
@VladMatvienko 因为它显示在 Android 上,我猜。
-
我喜欢我们为了编辑而编辑@VladMatvienko
-
只是一个建议,iOS似乎部分支持
background-attachment: fixed- caniuse.com/#search=background-attachment