CSS background-position not working in Mobile Safari (iPhone/iPad)

后端 未结 5 1649
面向向阳花
面向向阳花 2020-12-06 00:43

I have an issue with background-position in mobile safari. It works fine on other desktop browsers, but not on iPhone or iPad.

body {
 background-color: #000         


        
5条回答
  •  隐瞒了意图╮
    2020-12-06 01:17

    Apparently, when you "scroll" on an iPhone / iPad, you're not scrolling the page in the same way as you do in a desktop browser. What you're doing is more like moving the whole page within a viewport. (I'm sure someone will correct me if I'm using the wrong terminology here.)

    This means that background-position: fixed is still "supported" but has no real effect, since the whole page is moving within the viewport rather than the page content scrolling within the page.

提交回复
热议问题