HTML5兼容 – 类属性中的尾随空格

前端之家收集整理的这篇文章主要介绍了HTML5兼容 – 类属性中的尾随空格前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我知道技术上 HTML5是一个“生活规范”,但我想知道它是否符合类名中的尾随空格.我在规范中没有看到任何对这种情况的引用,但是我的一个队友说它无效.也许我错过了什么?

修剪那些空间(我在大型Java ecom应用程序中工作)会很痛苦,我想知道它是否值得为SEO,验证或任何其他目的而做.我觉得这不是……哈哈

解决方法

正如我们在下面的链接中看到的那样,开发人员可以在class属性中使用的内容没有限制.

http://www.w3.org/html/wg/drafts/html/master/dom.html#classes

事实上,在说出类是什么以及它们被用于拆分空间之后,作者说:

There are no additional restrictions on the tokens authors can use in
the class attribute,but authors are encouraged to use values that
describe the nature of the content,rather than values that describe
the desired presentation of the content.

我们这里的同事经过测试并成功通过了W3C验证,所以我无法猜到为什么你的朋友认为它无效.

原文链接:https://www.f2er.com/html5/168260.html

猜你在找的HTML5相关文章