Can XHTML and HTML class attributes value start with a number?

后端 未结 3 405
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 11:54

Can XHTML and HTML class attributes value start with a number?

3条回答
  •  庸人自扰
    2020-11-29 12:47

    From the CSS spec:

    "In CSS3, identifiers (including element names, classes, and IDs in selectors (see [SELECT] [or is this still true])) can contain only the characters [A-Za-z0-9] and ISO 10646 characters 161 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit or a hyphen followed by a digit. They can also contain escaped characters and any ISO 10646 character as a numeric code (see next item). For instance, the identifier "B&W?" may be written as "B\&W\?" or "B\26 W\3F". (See [UNICODE310] and [ISO10646].)"

提交回复
热议问题