validation - CSS 验证未验证

标签 validation css w3c-validation

/* ** ** custom select color ** ** */
::selection {
 background: #525252; /* Safari */
}
::-moz-selection {
 background: #525252; /* Firefox */
 color:#fff;
}

上面的代码没有通过 W3C 验证器,但我无法理解其中的原因。

返回以下错误:

The pseudo-element ::selection can't appear here in the context css21 [selection]

The pseudo-element ::-moz-selection can't appear here in the context css21 [-moz-selection]

最佳答案

1        The pseudo-element ::selection can't appear here in the context css21 [selection]
4        The pseudo-element ::-moz-selection can't appear here in the context css21 [-moz-selection]

这没什么好担心的,第一个是提示,因为它正在针对 CSS2.1 进行测试,第二个,正如 Kyle 所建议的,是因为 -moz 前缀

要消除第一个“错误”,请执行以下操作:

enter image description here

单击更多选项链接并将配置文件更改为 CSS 3。

这不能消除第二个错误,应该学会忽略这种错误。我知道这听起来很痛苦,除非有人可以提供替代建议吗?

关于validation - CSS 验证未验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4931040/

相关文章:

jQuery 可拖动的 appendTo 不起作用

html - 将下拉菜单居中对齐

html - 超链接中的 & 号导致 W3C 验证失败

python - 密码验证 - Python

css - Woocommerce 店面如何不隐藏移动设备上的搜索栏

html - Magento 1.7.0.2 header 中的 W3 验证器错误

CSS 验证 : "Parse Error: @keyframes"

java - Spring MVC 中的 JSR-303 自定义 ConstraintValidator

php - 在 Laravel 4 中显示自定义验证的错误消息

c# - NHibernate Validator - 传递资源管理器和 key