I want to know whether numbers(only) can be used for naming a css class
is this valid?
.2{
display:block;
}
No, it's not valid. But the more important fact is that you shouldn't define classes with no meaning as that doesn't make any sense when looking at writing semantic markup.
In CSS1, a class name could start with a digit (".55ft"), unless it was a dimension (".55in"). In CSS2, such classes are parsed as unknown dimensions (to allow for future additions of new units) To make "2x" a valid class, CSS2 requires the first digit to be escaped ".\32x" [2x]
No you can't, it throw the selector rule exception. its like declaring a variable in c or cpp... if u declare as 2 then its not a variable, its a constant. because int num=2; this is always correct form but string 2=num; is always wrong in programming. Read more from http://www.w3.org/TR/CSS21/selector.html
No you can not use only numbers as a css3 class name. but check this link out.
No,it's not working.
a lot of language is not support the first word is number.
Maybe you can use .menu-1