CSS 身高在 Android chrome 中搞砸了
CSS height messed up in Android chrome
我正在制作一个网络聊天应用程序。它不适合实际使用 - 只是一个培训项目。我在 android 中遇到 css 身高 属性 的问题。我的应用程序在桌面 chrome 上表现正常,但在 android 上高度保持不变,不管我输入什么值 css,它也阻止我向下滚动到底部我的页面。经过半小时的研究,我发现了这些主题:
https://github.com/angular/material/issues/6841
https://bugs.chromium.org/p/chromium/issues/detail?id=546034#c6
但是 none 他们的解决方案对我有用 - 我都试过了:将我的元素设置为:
display = fixed;
并定义:
min-height: 0;
正如建议的那样。一点作用都没有。如果有人可以检查 Git? I also have it uploaded on firebase。有趣的是:我整天都在担心宽度,现在我无法固定高度。任何帮助将不胜感激。
看起来 Chrome for Android 有一些问题..所以如果页面 can 水平滚动,也会垂直滚动。
要解决此问题,请尝试 position:fixed
如下代码:
@media only screen and (max-width: 960px) and (orientation: portrait) {
#wrapper {
width:98%;
margin-left:2%;
position: fixed;
}
}
您也可以添加这些代码来修复页面中的一些高度问题
#chat {
height: calc(100% - 50px);
}
@media only screen and (max-width: 960px) and (orientation: portrait) {
#chat-wrapper #chat-box {
height: calc(100% - 90px);
}
}
希望对您有所帮助..
我正在制作一个网络聊天应用程序。它不适合实际使用 - 只是一个培训项目。我在 android 中遇到 css 身高 属性 的问题。我的应用程序在桌面 chrome 上表现正常,但在 android 上高度保持不变,不管我输入什么值 css,它也阻止我向下滚动到底部我的页面。经过半小时的研究,我发现了这些主题:
https://github.com/angular/material/issues/6841 https://bugs.chromium.org/p/chromium/issues/detail?id=546034#c6
但是 none 他们的解决方案对我有用 - 我都试过了:将我的元素设置为:
display = fixed;
并定义:
min-height: 0;
正如建议的那样。一点作用都没有。如果有人可以检查 Git? I also have it uploaded on firebase。有趣的是:我整天都在担心宽度,现在我无法固定高度。任何帮助将不胜感激。
看起来 Chrome for Android 有一些问题..所以如果页面 can 水平滚动,也会垂直滚动。
要解决此问题,请尝试 position:fixed
如下代码:
@media only screen and (max-width: 960px) and (orientation: portrait) {
#wrapper {
width:98%;
margin-left:2%;
position: fixed;
}
}
您也可以添加这些代码来修复页面中的一些高度问题
#chat {
height: calc(100% - 50px);
}
@media only screen and (max-width: 960px) and (orientation: portrait) {
#chat-wrapper #chat-box {
height: calc(100% - 90px);
}
}
希望对您有所帮助..