I’ve been developing a site and recently came across that naming a css class or id ‘404’ (with no quotes of course) will not display any styling for the element named 404.
I did not know this until I had to well, create a 404 page and named the element accordingly.
(I’m actually surprised I haven’t run into this before.)
Is there and specific reason behind this?
Excuse my ignorance if it’s something simply obvious, been up for 48 hours coding and was flipping out at first because I thought my browser wasn’t refreshing my css file properly! 😛
Anyway I’ve simply renamed the element and the styling works.
404is not a valid identifier. You basically have to start an identifier by a letter or an underscore (or maybe some other characters such as$and-).Please also not that it doesn’t have anything to do with HTML4/5 .. it’s a CSS rule. CSS identifiers must be conform to the following rules (including in CSS3) :