I am using the W3 CSS validator and when trying to validate my code it finds these errors:
121 thead Value Error : background-color #e422357a is not a background-color value : #e422357a 125 tbody Value Error : background-color #1515157a is not a background-color value : #1515157a 129 tfoot Value Error : background-color #e8b63d7a is not a background-color value : #e8b63d7a
This is the code in question. This is for a school assignment and my professor told me it's important that I validate my code, but I can't seem to figure out what is wrong with it?
Aren't 8 digit hex colors valid background colors?
thead {
background-color: #e422357a;
}
tbody {
background-color: #1515157a;
}
tfoot {
background-color: #e8b63d7a;
}
Run Code Online (Sandbox Code Playgroud)
正如下面 Temani Afif 所澄清的那样,您的代码没问题,但验证器无法识别它。由于这似乎是家庭作业,我建议您使用 3 字节代码(除非项目要求强制使用),但要了解您的代码确实有效。请记住,您使用的工具可能是您的讲师使用的工具,他们可能会从表面上看,而不进行更深入的挖掘。 我必须仔细检查规范,但改用 3 字节代码。第 4 个字节用于 alpha(透明度)通道,验证器无法识别。
详细来说,可以通过以下方式指定颜色。
您已指定 RGBA,但验证器不喜欢它。放弃第四个字节或使用能够识别真正合规代码的验证器。
编辑: 尝试 W3 自己的验证服务。
| 归档时间: |
|
| 查看次数: |
402 次 |
| 最近记录: |