Reactjs:最新的谷歌Chrome Android中的滚动问题?迁移的早期版本:99.xxxxxx....最新版本:116.xxxxxx

42fyovps  于 12个月前  发布在  Go
关注(0)|答案(1)|浏览(65)

早些时候我的网站工作正常,它是全屏的。后来我更新了Chrome(Android)到最新的(116.xxxxxx....)。现在它显示滚动,这在早期版本(99.xxxxxx...)中是不使用的。
尝试了大多数CSS解决方案,如下所示。

html, body {
    scroll-behavior: smooth;
    overflow-x: hidden!important;
}

AND

html {
        scroll-behavior: smooth;
        overflow-x: hidden!important;
}
body {overflow-x: hidden;}

对这个问题有什么想法吗?

huwehgph

huwehgph1#

终于找到了答案
这是由谷歌Chrome(Android)的最新调整行为引起的。
解决方案是添加:

<meta name="viewport" content="width=device-width, initial-scale=1.0, interactive-widget=resizes-content">

在index.html文件中。
如果您使用过Chrome(Android),则必须为应用程序准备最新的调整大小行为
position:fixed
在您的Web布局中。
参考:https://developer.chrome.com/blog/viewport-resize-behavior/

相关问题