需要一些帮助。
在 CSS lint 中查看我的 CSS 时,他们不断报告解析错误,即“预期的 LBRACE 错误” 这是问题的屏幕截图:screenshot
他们在我的右括号中显示了问题。我检查了我的代码好几次,但我就是找不到问题所在。
我意识到如果我更改关键帧前缀顺序,则错误会显示在不同的行上(因此并不总是在右括号上)
这是我的代码,请看一下,如果有人看到那里有错误,请告诉我错误是什么,提前谢谢:
.flat-desktop-content {
background: url("../images/flat-desktop-content.svg") no-repeat scroll 0 0 transparent;
background-size: cover;
width: 360px;
height: 290px;
position: absolute;
top: 0;
left: 0;
z-index: 9;
-webkit-animation: flat-desktop 6s ease infinite;
-moz-animation: flat-desktop 6s ease infinite;
animation: flat-desktop 6s ease infinite;
}
@-webkit-keyframes flat-desktop {
0% { background-position: 0 0; }
50% { background-position: 0 -234px;}
0% { background-position: 0 0; }
}
@-moz-keyframes flat-desktop {
0% { background-position: 0 0; }
50% { background-position: 0 -234px;}
0% { background-position: 0 0; }
}
@keyframes flat-desktop {
0% { background-position: 0 0; }
50% { background-position: 0 -234px; }
0% { background-position: 0 0; }
}
最佳答案
CSSLint 不是罪魁祸首。
问题是导致错误的代码中存在不可见字符。只需将光标放在有问题的行和列上,然后按退格键即可删除有问题的字符。
如果您将下面的代码复制到 csslint,您将不会收到错误,因为我删除了违规字符。
@keyframes monkey {
0% { background-position: 0 0; }
50% { background-position: 0 -100px; }
}
关于parsing - CSS lint 解析错误 - 预期的 LBRACE 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28347983/