The id attribute got more classy in HTML5 · Mathias Bynens
HTML5 relaxes the restrictions on id attribute values, allowing them to contain any character except spaces (and must be non-empty and unique), whereas HTML 4.01 required ids to start with a letter and only contain letters, digits, hyphens, underscores, colons, and periods. This means id attributes now follow the same permissive rules as class attributes, enabling unconventional but valid identifiers like "#", "♥", or even brainfuck code snippets. Targeting these unusual id values in CSS requires careful character escaping to avoid conflicts with CSS syntax.