The HTML spec tells us that id
(and name
) attributes:
must begin with a letter ([A–Z[,]a–z]) and may be followed by any number of letters, digits ([0–9]), hyphens (-), underscores (_), colons (:), and periods (.).
I decided to test it out. I duplicated a previous posting and added a paragraph at the very end.
For its id
entifier, I removed all illegal characters from an entire chapter of my book. That’s 39,209 characters. Yes, it clears the validator.
And you’d probably like to hit a link to that paragraph now, wouldn’t you?