【问题标题】:media query firefox not working媒体查询火狐不工作
【发布时间】:2017-10-16 16:03:35
【问题描述】:

我尝试在 Firefox 上使用媒体查询,但它不起作用,它适用于 Chrome。我没有安装扩展,所以我认为问题不在这里。

这是我的媒体查询:

@media screen
and (min-width: 1200px)
and (min-device-width: 1200px)
and (-webkit-min-device-pixel-ratio: 1) {
 #live-chat {
    bottom: 0;
    font-size: 12px;
    right: 200px;
    position: fixed;
    width: 300px;
    z-index:1;
 }
}

如果你有想法 :) 我从昨天开始搜索,但一无所获

问候

【问题讨论】:

    标签: css firefox media-queries


    【解决方案1】:

    试试 @media only screen and (min-width: 768px) { rules }

    http://brettjankord.com/2012/11/28/cross-browser-retinahigh-resolution-media-queries/

    【讨论】:

    • 是的,它会起作用,但就像我之前说的那样,它是 -webkit-min-device-pixel-ratio: 1,Firefox 不支持它
    • @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and ( min-resolution: 192dpi), only screen and ( min-resolution: 2dppx) { /* 这里是视网膜特定的东西 */ }
    【解决方案2】:

    感谢这个网站,我终于找到了解决方案:http://mediaqueriestest.com/

    (-webkit-min-device-pixel-ratio: 1) 在 Firefox 上为 false,因为它不受支持

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-05
      • 2023-03-22
      • 1970-01-01
      • 2016-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多