[thelist] CSS selectors

Simon Perry simon.perry at si-designs.co.uk
Wed Feb 25 15:34:31 CST 2004

Alvaro Medina wrote:

>Hello, this may be a dumb question but anyway I have this little doubt : what is the difference between
>.someclass { }
>anytag.someclass { }
>? I mean it for practical matters. I know the first could be assigned to any tag, as the second is just for it; then, could one declare
>div.someclass { }
>p.someclass { }
>and so on? Is there a difference? Will the agent recognize it as 2 different classes? and whats the point, since one could declare different classes names to different tags?
It's all about specificity [0] however there are those who are better at 
explaining further [1].


[0] http://www.w3.org/TR/REC-CSS2/cascade.html

More information about the thelist mailing list