8位十六进制不是背景颜色值 [英] 8-digit hex is not a background-color value

查看:266
本文介绍了8位十六进制不是背景颜色值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用W3 CSS验证器,并在尝试验证我的代码时发现以下错误:

I am using the W3 CSS validator and when trying to validate my code it finds these errors:

121 thead值错误:background-color#e422357a不是背景颜色值:#e422357a 125 tbody值错误:background-color#1515157a不是背景颜色值:#1515157a 129英尺值错误:背景颜色#e8b63d7a不是背景颜色值:#e8b63d7a

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?

8位十六进制颜色不是有效的背景颜色吗?

Aren't 8 digit hex colors valid background colors?

thead {
    background-color: #e422357a;
}

tbody {
    background-color: #1515157a;
}

tfoot {
    background-color: #e8b63d7a;
}

推荐答案

Jigsaw W3C CSS验证器不了解最新的开发标准,例如大多数4级CSS功能.引入和实施新功能的速度超过了标准化或验证者可以赶上的速度,因此验证已变得越来越不可靠,除了对潜在的粗心错误进行健全性检查以外,还不如传统的符合标准的证明"(如果您愿意的话) ).

The Jigsaw W3C CSS validator isn't known for being up to date with developing standards, such as most level 4 CSS features. New features are being introduced and implemented faster than they can be standardized or validators can catch up, so validation has become increasingly unreliable as anything other than a sanity check for potential careless mistakes, rather than traditional standards-compliance "certification" (if you will).

只要您在理解浏览器支持不完整并且这些草稿可能会发生变化的前提下使用该表示法(尽管对这种表示法的支持极不可能会更改),您将很好.

As long as you use the notation with the understanding that browser support isn't complete and these drafts are subject to change (although support for this notation is extremely unlikely to change), you'll be fine.

如果您 担心验证,最好的选择是将这些值重写为与rgba()对应的值,它们具有跨浏览器支持被Jigsaw识别

If you are concerned about validation, your best bet is to rewrite these values to their rgba() counterparts, which enjoy cross-browser support and are recognized by Jigsaw.

这篇关于8位十六进制不是背景颜色值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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