CSS 类未在 iOS 浏览器中显示,但在 Android 中有效

标签 css

我正在编写一个带有 facebook 风格聊天窗口的网页。它在浏览器中运行良好,CSS 如下所示:

.chatWindowContainer {
    display: flex;
    flex-flow: column;
    position: absolute;
    bottom: 0px;
    right: 15%;
    margin-left: 10px;
    background-color: white;
    width: 350px;
    box-shadow: 0 20px 20px 5px rgba(0, 0, 0, 0.2),
        0 0px 10px 0 rgba(0, 0, 0, 0.19);
}

对于移动设备,我希望窗口横跨整个屏幕底部。我使用媒体查询:

@media screen and (max-width: 800px) {
    .chatWindowContainer {
        width: 100%;
        right: 0%;
    }
}

在 Chrome 中使用 devtools 并使用设备视口(viewport)时,一切看起来都很好。这也适用于 Android 版 Chrome,但不适用于 Safari、Edge 或 iOS 版 Chrome,我不明白为什么。无论如何我可以检查我是否收到错误消息或类似信息?

最佳答案

我想通了...

我使用使用 Web Speech API 的 react 包“react-speech-recognition”。除了 Chrome 和 Android 版 Chrome 之外,其他任何东西都不支持此功能。当删除我的 WebApp 周围的 SpeechAPI 包装器时,ChatWindow 会出现在 iOS 中。

所以这不是 CSS 的问题,而是 JS 的问题。

关于CSS 类未在 iOS 浏览器中显示,但在 Android 中有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55608413/

相关文章:

css - Chrome 和 Firefox 不会渲染我的 @font-face,safari 会

html - 即使在使用媒体查询后,opera-mini 上的水平滚动条

html - IE9 CSS 在 li 中排列两个元素的问题

javascript - 如何根据浏览器设备添加/删除html元素和内容?

html - 如何让我的导航栏加载到我的元素动画之上

css - 为什么我的 CSS 宽度百分比在某些页面上会发生变化?

html - 尝试向下拉伸(stretch)背景,但仍留有空白

javascript - 特定函数的引用错误

css - 以 HTML 为中心的 DIV

html - :first-child border-top-right-radius wont work