CSS Style window background beyond page on Mac possible?

后端 未结 3 1821
一个人的身影
一个人的身影 2021-01-19 21:36

Is it possible to style or color the window pane background of the browser?
When scrolling beyond the edge in Chrome and Safari on Mac,
the whole page is pulled a bi

3条回答
  •  无人共我
    2021-01-19 22:24

    Set the body colour body {background-color: white} should work.

    More complex, if you need to change the overscroll colour, while leaving the body colour white (only tested on iOS10.3 Safari). I did the following using a 1x1 white pixel:

    body {
        background-color: rgba(0, 0, 0, 0.4);
        background-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAP7//wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==);
        background-size: 100% 100%;
    }
    

    FYI 1: three other things I tried that didn't work for me were: outline: 100px solid rgba(0, 0, 0, 0.4);, box-shadow: 0 0 0 100px rgba(0, 0, 0, 0.4);, and background: #FFF, rgba(0, 0, 0, 0.4);.

    FYI 2: I recall that really old versions of Safari needed the colour set on the html element.

提交回复
热议问题