I'm basing my answer on html
rather than just CSS. Documentation:
To summarize, the id must apparently begin with a letter (A-Za-z
) and can have any other letters, numbers, underscore, or dash after that. Practically, you can start the id
with -
or _
and it will work: http://jsfiddle.net/ExplosionPIlls/y6jvs/ but starting with a number does not work.
While these restrictions don't appear to apply to classes which are a CDATA list, practically it seems to work the same: http://jsfiddle.net/ExplosionPIlls/y6jvs/1/
So you get a consistent and future proof browser experience, I would try to avoid doing anything funky with IDs, class names, etc.