无效 CSS 错误: “预期表达式”

我一直在跟踪 无礼教学。由于某些原因,尽管 Sass 文件没有正确地生成 css。终端说 css 是无效的,但我很确定它不是。我也试过换,以防万一。

我做错了什么?

Sass 版本: Sass 3.1.10

错误信息:

error sass/test.sass (Line 3: Invalid CSS after "80%":
expected expression (e.g. 1px, bold), was ";")

. sass 文件内容:

/* style.scss */
#navbar {
width: 80%;
height: 23px;
}
68221 次浏览

Based on your error message (error sass/test.sass) I can tell you're using the .sass extension for a Scss file. Change your file name to style.scss.

Sass and Scss use two different and incompatible syntaxes.

Try either:

/* style.scss */
#navbar {
width: 80%;
height: 23px;
}

Or:

/* style.sass */
#navbar
width: 80%
height: 23px

Note the difference in file extension and syntax.