问题
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?
回答1:
I have seen your site, it seems that you haven't declared overflow-x: hidden
for your html
tag. Please do. It seems to solve the problem.
回答2:
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...
来源:https://stackoverflow.com/questions/32666663/overflow-x-hidden-is-not-working-in-safari