2

Need some help.

When looking at my CSS in CSS lint, they constantly report a parsing error, namely 'expected LBRACE error' Here is a screenshot of the issue: screenshot

They show issue on my closing bracket. I checked my code several times, and I just can't find, what could be the issue.

What I realized if I change the key-frame prefix order, then the error shows on different lines (so not always on the closing bracket)

Here is my code, please take a look, and let me know if somebody sees an error there, and what is it, thank you in advance:

.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; }
}​
4

2 回答 2

4

CSSLint 不是罪魁祸首。

问题是您的代码中存在导致错误的不可见字符。只需将光标设置到有问题的行和列,然后按退格键即可删除有问题的字符。

如果您将下面的代码复制到 csslint,您将不会收到错误,因为我删除了有问题的字符。

@keyframes monkey {
    0% { background-position: 0 0; }
    50% { background-position: 0 -100px; }
}
于 2016-01-06T21:32:14.970 回答
0

您正在使用似乎有错误的csslint.net 。我简化了你的示例,直到我只剩下这个完全有效的 CSS 的简短片段,并且仍然抛出错误。试试看...

@keyframes monkey {
    0% { background-position: 0 0; }
    50% { background-position: 0 -100px; }
}​
于 2015-02-05T16:02:28.977 回答