Background size on iOS

前端 未结 2 713
-上瘾入骨i
-上瘾入骨i 2020-12-08 12:12

I\'ve spent the morning doing research on the following issue. I\'m making a one page site, using a lot of images. I\'m aware that Safari is known for its weird handling of

2条回答
  •  爱一瞬间的悲伤
    2020-12-08 12:40

    Short answer: you can’t (for now).

    You can play with @media screen and (max-width: 1024px) {} but for now iPad Pro have resolution more then ordinary monitors.

    I offer you to disable fixed attachment for mobiles via this way:

    Main CSS file:

    .parallax {
       background-attachment: fixed;
       background-size: cover;
    }
    

    Main HTML

    
    

    Additional fixparallax.css

    .parallax {
       background-attachment: scroll !important;
    }
    

提交回复
热议问题