What does ".." mean at the start of a CSS selector?
I'm trying to diagnose some bad formatting coming out of someone elses CSS. Their CSS file has a lot of entries in the form:
..foo { font-size: 10px; color: #000000; text-decoration: none }
The Firefox web developer plugin says:
Expected identifier for class selector but found '.'. Ruleset开发者_Python百科 ignored due to bad selector.
I read through http://www.w3.org/TR/CSS2/selector.html and the best I can figure is that if "*" can be omitted, that "..foo" means ..foo".
So, what does "..foo" mean?
it's a hack! (IE only.... of course)
but I encourage you to remove it, it is obsolete and causing trouble...
When in doubt, validate! :)
http://jigsaw.w3.org/css-validator/
It's a typo, it might work on some obscure version of IE but in general it's just invalid syntax.
It's a manner of formatting a selector that is specific to IE, allowing conditional formatting. There are more "correct" ways of accomplishing the task; as Caspar said, its' a hack.
精彩评论