0

我在文档的头部使用了主要的媒体断点:

<!-- Base = Normalize for basic and small screens -->
<link rel="stylesheet" href="css/base.css">
<!-- Enhanced = Styles for devices that understand media queries -->
<link rel="stylesheet" href="css/enhanced.css" media=”screen, handheld” />
<!-- Medium = Devices larger then generlized phone size -->
<link rel="stylesheet" href="css/medium.css" media=”only screen and (min-width:37em)”/>
<!-- Large = Larger tablets and desktops -->
<link rel="stylesheet" href="css/large.css" media=”only screen and (min-width:45em)”/>
<!-- Extralarge = Large displays and tv -->
<link rel="stylesheet" href="css/extralarge.css" media=”only screen and (min-width:60em)”/>

四个样式表由几个 _partials 组成。当我保存在其中一个 scss 文件中时,codekit 运行并且 Chrome 刷新并且一切都呈现得很好。但是,当我刷新浏览器时,所有样式都没有应用。css 文件存在,但没有应用任何内容。当我在该文件中有一个带有媒体查询的 screen.scss 文件时,一切正常,但现在它们被拆分了,什么都不适用。我在这里想念什么?

4

1 回答 1

1

我在您的 HTML 中看到花哨的花式引号。修复它们应该会导致您的媒体查询被识别:

<!-- Base = Normalize for basic and small screens -->
<link rel="stylesheet" href="css/base.css">
<!-- Enhanced = Styles for devices that understand media queries -->
<link rel="stylesheet" href="css/enhanced.css" media="screen, handheld" />
<!-- Medium = Devices larger then generlized phone size -->
<link rel="stylesheet" href="css/medium.css" media="only screen and (min-width:37em)"/>
<!-- Large = Larger tablets and desktops -->
<link rel="stylesheet" href="css/large.css" media="only screen and (min-width:45em)"/>
<!-- Extralarge = Large displays and tv -->
<link rel="stylesheet" href="css/extralarge.css" media="only screen and (min-width:60em)"/>
于 2012-09-07T20:58:55.890 回答