有效的 CSS“重要”吗? (jQuery UI CSS 不验证。)

发布于 2024-10-04 11:25:44 字数 443 浏览 3 评论 0原文

观察 jQuery UI CSS 未通过验证。

无论我能找到什么标准,我都会尽力遵守。我正在研究 jQuery UI,并想知道为什么一群开发出可靠产品的开发人员似乎甚至不承认 W3C 强加的标准。

W3C CSS 验证器是否太挑剔了?或者我应该更加注意这些错误/警告?

遵守有效的 CSS 重要吗?为什么你觉得它很重要?

Observe that the jQuery UI CSS does not pass validation.

I try to adhere to standards wherever I can find them. I'm looking at jQuery UI and wondering why a group of developers that makes a solid product doesn't seem to even acknowledge the W3C-imposed standards.

Is the W3C CSS Validator just too picky? Or should I pay better attention to these errors/warnings?

Is valid CSS important to adhere to? Why do you feel it's important?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

行至春深 2024-10-11 11:25:44

在完美世界中,是的,这很重要。事实上,要让 CSS 在每个浏览器中看起来都很棒需要一些……创造力。结果是,它可能不是严格有效的,但可以在(例如)IE 和 Safari 中工作,即使它们对相同规则的解释可能非常不同。

我认为 HTML 验证更为重要,因为它是您的内容。屏幕阅读器或其他辅助工具取决于标准化和结构良好的内容。但 CSS 只是为了让东西看起来更漂亮。如果它看起来不错,符合你的要求,那么我会称之为完全“有效”。

In perfect world, yes it would be important. In reality, to make CSS look aewsome in every single browser requires some... creativity. The result is that it may not be strictly valid, but works in (for example) IE and Safari both, even they can interpret the same rules very differently.

I think HTML validation is much more important, because its your content. Screen readers or other accessibility aids depend on standardized and well structured content. But CSS is just to make things look nice. And if it looks nice every you want it be, then I would call that perfectly "valid".

衣神在巴黎 2024-10-11 11:25:44

还可以尝试在 3.0 而不是 2.1 中进行验证。这可以处理大约 20 个错误。

许多错误是特定于浏览器的未知属性的错误(例如 -moz-opacity)。观察剩余的 112 个错误中有多少包含“-moz-”、“-webkit-”或有关 IE 过滤器的内容。这些属性用于在未实现 CSS 3.0 规范的浏览器之间实现一致性。

Also try validating in 3.0 instead of 2.1. That takes care of about 20ish errors.

Alot of the errors are errors of unknown properties which are browser specific (such as -moz-opacity). Observe how many of the remaining 112 errors include '-moz-', '-webkit-' or something regarding IE filters. These properties are used to achieve consistency across browsers that don't implement the CSS 3.0 spec.

非要怀念 2024-10-11 11:25:44

不一定要遵循标准,但我会鼓励您尽最大努力,同样,有时有必要打破浏览器兼容性标准。

It is not neccesary to follow standards but I would encourage it to the best of your ability, on that same note it is sometimes necessary to break standards for browser compatibility.

我恋#小黄人 2024-10-11 11:25:44

验证是一种有用的、自动化的发现错误的方法。如果您故意使用无效代码,那么您就失去了自动发现错误的方法。

也就是说,验证器需要升级才能识别 -vendor- 前缀是有效的。 (或者需要升级规范才能将这些前缀分类为有效,因为它们可以工作 - 参见 HTML5。)

Validation can be a useful, automated way to spot errors. If you use invalid code intentionally, then you’ve lost your automated way to spot errors.

That said, the validator needs to be upgraded to recognise that -vendor- prefixes are valid. (Or the spec needs to be upgraded to classify these prefixes as valid, because they work — c.f. HTML5.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文