【问题标题】:Second @media query not working第二个@media 查询不起作用
【发布时间】:2014-12-09 09:09:24
【问题描述】:

我正在开发一个网站,我想使用媒体查询来更改两种不同屏幕尺寸的一些 CSS。我希望 new new css.css 成为主要 css,然后 medium.css 中的规则在屏幕宽度介于 955px 和 650px 之间以及 small .css 在屏幕宽度低于 650 像素时启动

这是指向我的 HTML 中样式表的链接

<link href="new new css.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" media="only screen and (max-width: 955px) and (min-width: 650px)" href="medium.css" />
<link href="small.css" rel="stylesheet" type="text/css" media="only screen and (max-width: 650px) />

medium.css 可以正常工作,但低于 650 像素时,页面会返回到仅使用 new new css.css 并且没有 small 中的任何规则.css 应用

【问题讨论】:

    标签: html css media-queries


    【解决方案1】:

    此部分没有右引号:

    type="text/css" media="only screen and (max-width: 650px) />
    

    应该是

    type="text/css" media="only screen and (max-width: 650px)" />
    

    【讨论】:

      猜你喜欢
      • 2015-10-26
      • 1970-01-01
      • 1970-01-01
      • 2016-09-16
      • 2019-01-17
      • 2023-03-05
      • 1970-01-01
      • 2018-10-12
      相关资源
      最近更新 更多