0

我已经放置了正确的媒体屏幕查询,它在桌面上运行良好(因为我改变了视口大小);但是,当我在 iPhone 4s 上调出它时,所有背景都消失了。我认为问题在于IOS不支持position:fixed的css。我做了很多研究,但没有找到合适的解决方案,有没有人对此有任何想法?

这是我的CSS:

/* Desktop */
#home{width: 100%;
    height: 1080px;
    background: url(../images/landingPage.png) no-repeat fixed;
    margin: 0 auto;}

#about{width: 100%;
    height: 1080px;
    background: url(../images/about.png) 50% 0 no-repeat fixed;
    margin: 0 auto;}

(还有四个部分具有相同的标记。)

/* Mobile */
@media only screen and (min-width: 320px) and (max-width: 640px){

#home{height: 960px;
    background-size: 100% 100%;
    position: relative;
    display: block;}
#about{height: 960px;
    background-size:100% 100%;
    position: relative;
    display: block;}

(还有四个部分具有相同的标记。)

4

0 回答 0