我已经放置了正确的媒体屏幕查询,它在桌面上工作正常(因为我更改了视口大小);但是,当我把它放在我的iPhone 4s上时,所有的背景都消失了。 我认为问题在于IOS不支持位置的css:fixed。我已经完成了大量的研究,并没有找到适当的解决方案,有没有人有任何想法解决这个问题?
这是我的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;}
(还有四个部分具有相同的标记。)