简体   繁体   English

SASS样式在保存scss文件时适用,但在浏览器刷新时不适用

[英]SASS styles apply when saving scss file but not on browser refresh

I am using major media breakpoints in the head of the doc: 我在文档的开头使用了主要的媒体断点:

<!-- 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)”/>

The four stylesheets are made up of several _partials. 四个样式表由几个_partials组成。 When I save in one of the scss files codekit runs and Chrome refreshes and everything renders just fine. 当我将其中一个保存在scss文件中时,codekit运行,Chrome刷新,一切正常。 However when I refresh the browser all the styles are not applied. 但是,当我刷新浏览器时,不会应用所有样式。 The css files are present but nothing gets applied. 存在css文件,但未应用任何文件。 Everything worked fine when I had one screen.scss file with media queries inside that file but now that they are split up nothing applies. 当我有一个screen.scss文件且该文件中包含媒体查询时,一切工作正常,但是现在将它们拆分开,则不适用。 What am I missing here? 我在这里想念什么?

I see curly fancy quotes in your HTML. 我在您的HTML中看到花式引号。 Fixing them should cause your media queries to be recognized: 修复它们将使您的媒体查询得到认可:

<!-- 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)"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM