首页 > 解决方案 > 小屏幕的 Firefox 特定媒体查询

问题描述

当浏览器最小化时,我无法为 Firefox 创建媒体查询。当屏幕尺寸的最大宽度为 767 像素时,我想应用以下查询。

 @-moz-document url-prefix()  {
  #inner-content {
    padding-top: 0px !important;
  }
}

我试过这个,但没有用。

@media only screen and (max-width:767px) {
  #header-outer-container {
    height: 50px !important;
  }

  #main-menu {
    top: 50px;
  }

  #inner-content {
    padding-top: 60px !important;
  }

  @-moz-document url-prefix()  {
    #inner-content {
      padding-top: 0px !important;
    }
  }
}

任何帮助将不胜感激。谢谢

标签: css

解决方案


以防它在将来对任何人有所帮助,这很有效:

@-moz-document url-prefix()  {
  @media only screen and (max-width:767px) {
    #inner-content {
      padding-top: 0px !important;
    }
  }
}

推荐阅读