我有一个 css 菜单,最初是一个模板,现在是定制的(但只是图形设计)。在 PC 上它运行良好,但我遇到了问题,例如Android 手机(Chrome 浏览器)。只有 MENU 标志应该是可见的,但从一开始所有菜单项都被下拉。此外,当您隐藏它时,当您向下滚动页面时它会再次弹出。这很烦人。
这应该是一段相关的代码:
@media all and (max-width: 768px),
only screen and (-webkit-min-device-pixel-ratio: 2) and (max-width: 1024px),
only screen and (min--moz-device-pixel-ratio: 2) and (max-width: 1024px),
only screen and (-o-min-device-pixel-ratio: 2/1) and (max-width: 1024px),
only screen and (min-device-pixel-ratio: 2) and (max-width: 1024px),
only screen and (min-resolution: 192dpi) and (max-width: 1024px),
only screen and (min-resolution: 2dppx) and (max-width: 1024px)
最佳答案
需要查看您的代码。使用 plunkr 或将您的文件上传到 github 并提供链接。
注意 - 如果您使用 CSS 为菜单设置动画,请尝试添加“animation-fill-mode: forwards”以保持打开/关闭菜单的状态。
关于android - 总是在android中下拉菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46172363/