Overflow:hidden not working on mobile browser

青春壹個敷衍的年華 提交于 2019-12-23 19:47:07

问题


Im using overflow:hidden to hide my unglam div in my webpage, it works well in all web browser but not in mobile browser. Anyone can help?

body
{
    margin: auto;
    display:block;
    overflow-x:hidden;
    overflow-y:hidden;
    height:800px;
} 

回答1:


Try adding following line in your html

<meta name="viewport" content="width=device-width, height=device-height">

and test on your phone. Maybe this should help.




回答2:


Add a wrapper inside your body tag and apply the overflow-x: hidden to that wrapper




回答3:


Depending on which mobile browser you're using, overflow-x and overflow-y may not be supported. Use overflow: hidden instead to cover all bases and be cross browser compatible.



来源:https://stackoverflow.com/questions/18268300/overflowhidden-not-working-on-mobile-browser

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!