JavaFX&渐变中的CSS'意外函数'

时间:2017-05-30 23:01:15

标签: java css javafx javafx-2

我在网上使用了一个按钮生成器并将css从它复制到我的javafx css。我选择了所有内容并使用“转换为W3C CSS”之类的东西......现在,我收到以下错误:

"com.intellij.rt.execution.application.AppMain 
com.package.project.Main
May 30, 2017 6:43:23 PM com.sun.javafx.css.parser.CSSParser declaration
WARNING: CSS Error parsing 

style.css: Unexpected function '-webkit-linear-gradient(' while parsing 
'background-image' at [27,22]
May 30, 2017 6:43:23 PM com.sun.javafx.css.parser.CSSParser declaration
WARNING: CSS Error parsing style.css: Unexpected function '-moz-linear-
gradient(' while parsing 'background-image' at [28,22]
May 30, 2017 6:43:23 PM com.sun.javafx.css.parser.CSSParser declaration
WARNING: CSS Error parsing style.css: Unexpected function '-ms-linear-
gradient(' while parsing 'background-image' at [29,22]
May 30, 2017 6:43:23 PM com.sun.javafx.css.parser.CSSParser declaration
WARNING: CSS Error parsing style.css: Unexpected function '-o-linear-
gradient(' while parsing 'background-image' at [30,22]
May 30, 2017 6:43:23 PM com.sun.javafx.css.parser.CSSParser declaration
WARNING: CSS Error parsing style.css: expected series of <size> while 
parsing 'text-shadow' at [35,17]
May 30, 2017 6:43:23 PM com.sun.javafx.css.parser.CSSParser declaration
WARNING: CSS Error parsing style.css: Unexpected function '-webkit-linear-
gradient(' while parsing 'background-image' at [46,22]
May 30, 2017 6:43:23 PM com.sun.javafx.css.parser.CSSParser declaration
WARNING: CSS Error parsing style.css: Unexpected function '-moz-linear-
gradient(' while parsing 'background-image' at [47,22]
May 30, 2017 6:43:23 PM com.sun.javafx.css.parser.CSSParser declaration
WARNING: CSS Error parsing style.css: Unexpected function '-ms-linear-
gradient(' while parsing 'background-image' at [48,22]
May 30, 2017 6:43:23 PM com.sun.javafx.css.parser.CSSParser declaration
WARNING: CSS Error parsing style.css: Unexpected function '-o-linear-
gradient(' while parsing 'background-image' at [49,22]

使用以下样式表:

.btn {
    background: #e60c0c;
    background-image: -webkit-linear-gradient(top, #e60c0c, #750f0f);
    background-image: -moz-linear-gradient(top, #e60c0c, #750f0f);
    background-image: -ms-linear-gradient(top, #e60c0c, #750f0f);
    background-image: -o-linear-gradient(top, #e60c0c, #750f0f);
    background-image: linear-gradient(to bottom, #e60c0c, #750f0f);
    -webkit-border-radius: 16;
    -moz-border-radius: 16;
    border-radius: 16px;
    text-shadow: 4px 3px 2px #666666;
    font-family: Arial;
    color: #b5abff;
    font-size: 27px;
    padding: 34px 34px 34px 34px;
    border: solid #253138 1px;
    text-decoration: none;
}

.btn:hover {
    background: #750f0f;
    background-image: -webkit-linear-gradient(top, #750f0f, #e60c0c);
    background-image: -moz-linear-gradient(top, #750f0f, #e60c0c);
    background-image: -ms-linear-gradient(top, #750f0f, #e60c0c);
    background-image: -o-linear-gradient(top, #750f0f, #e60c0c);
    background-image: linear-gradient(to bottom, #750f0f, #e60c0c);
    text-decoration: none;
}

有谁可以告诉我为什么我收到这些错误?谢谢大家

0 个答案:

没有答案