SASS:错误的原因是什么;预期的行尾“;?
我目前正在学习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个子项之间的空格。此外,添加位于每个属性
.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;
}