Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 为什么没有应用我的字体颜色?_Html_Css_Ajax_Colors - Fatal编程技术网

Html 为什么没有应用我的字体颜色?

Html 为什么没有应用我的字体颜色?,html,css,ajax,colors,Html,Css,Ajax,Colors,如果我在标签上设置了这样的字体: <label id="lblrptgenprogress" class="invisible redfont">Report generation list is being constructed...</label> CSS是: .redfont { color: red; } .midnightbluefont { color: midnightblue; } 更新 从评论中可以看出: .midnightblu

如果我在标签上设置了这样的字体:

<label id="lblrptgenprogress" class="invisible redfont">Report generation list is being constructed...</label>
CSS是:

.redfont {
    color: red;
}

.midnightbluefont {
    color: midnightblue;
}
更新 从评论中可以看出:

.midnightbluefont {
    /*color: midnightblue;*/ <= doesnt' work
    /*color: #191970;*/ <= doesn't work
    /*color: #191970 !important;*/ <= works
    color: midnightblue !important; <= works
}
.middnightbluefont{

/*颜色:午夜蓝;*/暴力工作方式如下:

.midnightbluefont {
    color: midnightblue !important;
}
……或者:

.midnightbluefont {
    color: #191970 !important;
}

很可能是css的特殊性,但我们无法从您提供的内容中确定。尝试使用十六进制而不是名称作为颜色。我怀疑这一点,但可能是。午夜蓝色是
#191970
,红色是
#FFFFFF
红色有效;没有理由更改它。@amflare,
#FFFFFF
是白色的。确实如此!休息一下,重新开始x!
.midnightbluefont {
    color: midnightblue !important;
}
.midnightbluefont {
    color: #191970 !important;
}