CSS pointer-events and appearance properties not recognized by CSS Validator

橙三吉。 提交于 2019-11-29 09:45:39

TL;DR: Focus more on the data in caniuse.com, which tells you what browsers are actually doing, as opposed to W3C validators, which require properties and values to achieve a high official status before being included. You'll often find properties and values that are too new or undeveloped for inclusion in the validators, but are nonetheless supported by major browsers.


From CSS Working Group archives:

I just checked my page redseen.3owl.com with the css validator.

I got this error:

Property pointer-events doesn't exist : none

Why is this shown as an error?

Because no CSS specifications currently define the pointer-events property. It is defined in SVG 1.1, but the use of pointer-events in CSS for non-SVG elements is experimental. The feature used to be part of the CSS3 UI draft specification but, due to many open issues, has been postponed to CSS4.

The W3C CSS Validator generally checks, in CSS3 mode, against a vague collection of documents, consisting of CSS 2.1 and selected "CSS3 specifications", excluding many that are still at Working Draft level - and pointer-events isn't currently defined even at WD level (or even in an Editor's Draft, as far as I can see).

http://lists.w3.org/Archives/Public/www-validator-css/2012Nov/0033.html

The excerpt above is from 2012. But it is still valid in 2017.

From MDN pointer-events:

[The pointer-events] extension to HTML elements, though present in early drafts of CSS Basic User Interface Module Level 3, has been pushed to its level 4.

The CSS appearance property appears to be in the same situation (MDN). It's currently in Editor's Draft status and, therefore, not included in the CSS Validator.


A Side Note

In all sites I've developed it was always easier to validate HTML than CSS. In fact, while most of the time I can achieve full HTML validation, I don't think I've ever achieved full CSS validation.

This is because I use properties that are supported by most browsers, but are not always at validator threshold status in the standardization process.

For this reason, I don't use the CSS validator for anything more than general information. I would suggest you don't let CSS validation errors stop you from moving forward.

Focus more on the caniuse.com website to check browser support for CSS properties. You'll find that the pointer-events property, despite not being in a current CSS spec, has been supported by most major browsers for some time now.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!