【问题标题】:Why Media query is not working on chrome browser?为什么媒体查询在 chrome 浏览器上不起作用?
【发布时间】:2019-10-07 16:28:10
【问题描述】:

媒体查询不适用于 chrome 浏览器。这是我的 CSS,它在 chrome 浏览器上不起作用。

@media screen and (min-width:320px) and (max-width:1000px) {
    .catalog-product-view section#body .product_page .detail_contentmain .detail_content {
       width: 100% !important;
    }
}

【问题讨论】:

  • 这应该可以,你到.detail_content 的路径很可能不正确。首先检查检查元素是否有效,如果有效,请直接从那里复制并粘贴到您的代码中。
  • 这段代码我们在firefox浏览器上工作
  • 只是不适用于 chrome 浏览器
  • 这是magento中的一个缓存问题,现在它在清除完整缓存后工作。 :)

标签: css media-queries


【解决方案1】:

请先试试这段代码

@media screen and (min-width:320px) and (max-width:1000px) {
body{
   display: none !important;
}}

因为这是您的选择器的问题,而不是媒体查询。

【讨论】:

  • 这段代码在 firefox 上运行,但对我来说在 chrome 上运行我试过了
  • 版本 77.0.3865.75 (Official Build) (64-bit) 这是我的 chrome 版本
  • 那么这是另一个问题而不是媒体查询问题。您是否在标题中放置了元标记()?
  • 这是magento中的一个缓存问题,现在它在清除完整缓存后工作。 :)
猜你喜欢
  • 2011-09-28
  • 2020-03-21
  • 1970-01-01
  • 1970-01-01
  • 2019-03-18
  • 2016-07-30
  • 1970-01-01
  • 1970-01-01
  • 2016-07-03
相关资源
最近更新 更多