Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SASS:错误的原因是什么;预期的行尾“;?_Sass - Fatal编程技术网

SASS:错误的原因是什么;预期的行尾“;?

SASS:错误的原因是什么;预期的行尾“;?,sass,Sass,我目前正在学习Sass。我遇到了一个小问题,我收到了这个错误:“预期行结束”。为什么我会出现这个错误,我能做些什么 .admin-table tr: nth-child(odd) // Generates the error background-color: $white .admin-table tr: nth-child(even) // Generates the error background-color: $white 去掉tr:和n个子项之间的空格。此外,添加位于每个属性

我目前正在学习Sass。我遇到了一个小问题,我收到了这个错误:“预期行结束”。为什么我会出现这个错误,我能做些什么

.admin-table tr: nth-child(odd) // Generates the error
 background-color: $white

.admin-table tr: nth-child(even) // Generates the error
 background-color: $white

去掉
tr:
n个子项之间的空格。此外,添加
位于每个属性的末尾,如下所示:

.admin-table tr:nth-child(odd){
    background-color: $white;
}

.admin-table tr:nth-child(even){
    background-color: $white;
}

对于Sass语法,您需要删除
:nth child)
中的空格,添加分号也是一个好主意
到每个属性的末尾

.admin-table tr:nth-child(odd)
  background-color: $white;


.admin-table tr:nth-child(even)
  background-color: $white;
对于Scss语法,您还需要添加大括号

.admin-table tr:nth-child(odd) {
  background-color: $white;
}


.admin-table tr:nth-child(even) {
  background-color: $white;
}