XHTML和HTML类属性值可以以数字开头吗? [英] Can XHTML and HTML class attributes value start with a number?

查看:106
本文介绍了XHTML和HTML类属性值可以以数字开头吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

XHTML和HTML类属性值是否可以以数字开头? 它们必须是SGML名称它们必须开始([A-Za-z]),后面跟随任意数量的字母,数字([0-9]),连字符( - ),下划线(_),冒号(: )和句号(。)。



然而,以数字开头的类名称是由IE支持的。



编辑: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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆