【问题标题】:Media query not being seen? Css [closed]没有看到媒体查询? CSS [关闭]
【发布时间】:2013-11-19 18:29:36
【问题描述】:

我遇到了一个问题,我决定在 style.css 的底部我会做上面的所有样式

.searchMoveDown, .moveIcons{
    display:visible;
}

@media (max-width: 768){
   /* Hide the search and icons in the nav.*/
  .searchMoveDown, .moveIcons{
      display:none;
  }
}

当我将屏幕缩小到小于 768 像素时,当我清楚地说display: none; 时,这两个类仍然可见,更糟糕的是,chrome 没有看到媒体查询。现在我决定在一个样式表中进行,主要是因为 bootstrap 就是这样做的,而且看起来比获取两个样式表更干净。

是我遗漏了什么还是......

对我来说这些都不起作用,也许我只是疯了。

【问题讨论】:

  • 你试过验证你的 CSS 吗?

标签: html css twitter-bootstrap media-queries


【解决方案1】:

您在查询中缺少单位!

@media (max-width: 768px){
   /* Hide the search and icons in the nav.*/
  .searchMoveDown, .moveIcons{
      display:none;
  }
}

【讨论】:

  • 该死,别特鲁布尔打败了我! :-)
  • 哈哈哈哈哈我想要那些点哈哈
【解决方案2】:

您的媒体查询中缺少 px 。

@media (max-width: 768px){
       /* Hide the search and icons in the nav.*/
      .searchMoveDown, .moveIcons{
          display:none;
      }
    }

【讨论】:

  • 我知道这很愚蠢>.>
  • 大声笑我们都这样做@LogicLooking
  • CSS 验证器是防止此类心理失误的良好第一道防线。
  • @Diodeus “无效的属性填充”、“抱歉,@-webkit-keyframes 的规则未知”……现在杀了我。
猜你喜欢
  • 2015-09-02
  • 2017-01-06
  • 2014-10-14
  • 2018-08-26
  • 2012-07-16
  • 1970-01-01
  • 2018-06-29
  • 2019-07-04
  • 1970-01-01
相关资源
最近更新 更多