在移动的背景图象被舒展或不显示

问题描述 投票:0回答:1

嗨人, 我真的不知道该怎么做了。我已经阅读了这些主题,并尝试了几乎所有我认为它可以工作的东西,但没有!

所以它在这里:我的背景图像显示和调整正常与桌面浏览器但在我的手机上(在这种情况下iPhone 6S),它被拉伸(看起来有点模糊)或根本没有显示。

链接到我的页面(http://lauramaliqi.com/about.html)

我的代码(我添加了H1和p - 以防万一它们影响了上层代码。这段代码也用于所有其他页面,也可以得到与此相同的结果。)

.top-bar-about { 
 color: #333;
 height: 350px;
 padding: 100px 0 10px;
 background: -webkit-linear-gradient( rgba(255, 255, 255, .8), rgba(255, 255, 255, .8)), url(../img/laura_background1.jpg);
background: linear-gradient( rgba(255, 255, 255, .8), rgba(255, 255, 255, .8)), url(../img/laura_background.jpg);
background-size: cover;
background-attachment: fixed;
background-position: center center;
text-align: center;}

.top-bar-about h1 { 
    font-size: 35px;
    font-weight: 400;
    color: #999;
    line-height: 50px;
    display: inline-block;
    text-align: center;}

.top-bar-about p { 
    font-size: 22px;
    font-weight: 300;
    color: #999;
    line-height: 10px;
    font-family:'Walter Turncoat', sans-serif;} 

我试过改变背景附件:固定滚动;改变了背景图片的大小,因为我在其中一篇文章中读到了可能也是问题。使用@media查询 - 没有结果。放下不重复然后它与我的桌面图像混淆......基本上我尝试过它只是不工作。

只是添加我知道有时缓存可能是浏览器中的一个错误但我在上传新文件但在手机上时一直删除缓存..该死的图片只是没有反应。就像冻结一样。

先感谢您!!

附:我也做了一些截图以防万一

它应该如何

现在怎么样

css image mobile background-image
1个回答
0
投票

刚刚检查了我的iOS 10设备并发现这是因为

 background-attachment: fixed;

再试一次,将移动设备的值从“固定”更改为“滚动”:

@media (max-width: 991px) {

 .top-bar-about{
    background-attachment: scroll;
    padding: 254px 0px !important;
 }

}

并确保样式不缓存,不要互相覆盖。

With background-attachment: fixed;

Width background-attachment: scroll;

© www.soinside.com 2019 - 2024. All rights reserved.