overflow-x: hidden, is not working in safari

后端 未结 3 1546
轮回少年
轮回少年 2020-12-19 21:43

I have a site that works well on every browser, except on Safari. On safari I can scroll horizontally for many thousands of pixels.

Anyone have had this issue?

3条回答
  •  遥遥无期
    2020-12-19 22:17

    Tried the answer supplied above but it didn't fix my issue so I'm leaving my research / fix here for any others looking for help in the future.

    I read that apparently Safari overlooks overflow when rendering so you have to target the body better? I gave the body a class and input the code below and this has fixed my issue.

    html, body {
    	position:relative;
    	overflow-x:hidden;
    }

    OR

    html, .custom-body-class {
    	position:relative;
    	overflow-x:hidden;
    }

    Hope this helps someone...

提交回复
热议问题