Can classes and IDs be numerical? For example: <div id="34">Content</div> #34 { margin:0; padding: 0; border: 1px solid #000; } Code (markup): Or: <div class="21">Content</div> .21 { margin:0; padding: 0; border: 1px solid #000; } Code (markup): It seems to be possible, having tried it. However, might some browsers have problems with it?
I remember, if you started class with number, it didn't work in Firefox, maybe it does now. So probably there might be some problems.
nothing doesn't happen no problem if use ugual name for class and for id #name .name <div id="name">Content</div> <div class="name">Content</div> Are different, but dont use number for th name of div and class. .
Doesn't matter if the browsers accept it or not. Numbers are not supposed to start identifiers. (hyphens aren't supposed to either). So if a browser does accept it, there's no guarantee it will always accept it. Look here for the details from the spec. : http://www.w3.org/TR/CSS21/syndata.html#characters
That's a good question DP, never thought about it before lol, have learned some thing from other members posts... Thanks goes to every one here.