What characters are allowed in a class name? #34253
Labels
Content:HTML
Hypertext Markup Language docs
help wanted
If you know something about this topic, we would love your help!
MDN URL
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
What specific section or headline is this issue about?
The main discription of the class attribute
What information was incorrect, unhelpful, or incomplete?
I think that "space-separated list" is not a clear enough description of what the value can be. Can it include any non-space unicode character? There is a link to the specification, but it is necessary to follow a second link after that to find this information.
What did you expect to see?
The actual rules, plus some guidance on best practices.
For example:
A space-separated list of tokens, each consisting of any character other than a space. For maximum compatibility, it may be recommended to use only letters, numbers, dashes and underscores.
Do you have any supporting links, references, or citations?
Link in article to spec: https://html.spec.whatwg.org/multipage/dom.html#global-attributes:classes-2
Extra links found in the spec, when read together gives a more complete answer
https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#set-of-space-separated-tokens
https://infra.spec.whatwg.org/#ascii-whitespace
Do you have anything more you want to share?
I encountered the class name "N/A" in the wild, and I came to MDN to find out if it is a valid class name.
MDN metadata
Page report details
en-us/web/html/global_attributes/class
The text was updated successfully, but these errors were encountered: