HTML IDs vs CSS
2022-03-13
While HTML allows any character in an id, CSS is much more strict. The
only (ASCII) punctuation characters you can use are -
and _
.
This also affects APIs which use CSS selectors to select elements, e.g. htmx or jQuery.