CSS皮棉分析错误-预期的LBRACE错误 [英] CSS lint parsing error - expected LBRACE error

查看:108
本文介绍了CSS皮棉分析错误-预期的LBRACE错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要帮助.

使用CSS皮棉查看我的CSS时,他们不断报告解析错误,即预期的LBRACE错误" 这是问题的屏幕截图:屏幕截图

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

推荐答案

CSSLint不应该受到指责.

CSSLint is not to blame.

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

The problem is that an invisible character is present in your code that is causing the error. Simply set your cursor to the offending line and column and hit backspace to erase the problematic character.

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

If you copy this code below to csslint you will not get an error because I removed the offending character.

@keyframes monkey {
    0% { background-position: 0 0; }
    50% { background-position: 0 -100px; }
}

这篇关于CSS皮棉分析错误-预期的LBRACE错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆