XHTML和HTML类属性值可以以数字开头吗? [英] Can XHTML and HTML class attributes value start with a number?
问题描述
XHTML和HTML类属性值是否可以以数字开头? 它们必须是SGML名称它们必须开始([A-Za-z]),后面跟随任意数量的字母,数字([0-9]),连字符( - ),下划线(_),冒号(: )和句号(。)。
编辑:meder指出你可以使用Unicode字符,它们似乎可以在所有浏览器中工作,我不知道它是否符合规范,但它确实似乎验证。
请参阅 http://css-tricks.com/unicode-class-names/ 和 http://snook.ca/archives/html_and_css/unicode_for_css_class_names
Can XHTML and HTML class attributes value start with a number?
No. They have to be SGML names. They "must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
However, class names that start with a number are supported by IE.
EDIT: meder pointed out that you can use Unicode characters and they seem to work in all browsers. I don't know if it complies with the specifications, but it does seem to validate. See http://css-tricks.com/unicode-class-names/ and http://snook.ca/archives/html_and_css/unicode_for_css_class_names
这篇关于XHTML和HTML类属性值可以以数字开头吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!