I have in my file "abc.css":
* +html .news .image{ .... }
What does this do? Any ideas?
According to Wikipedia the *+html
part is an IE7 "star plus" specific hack, which is based on an earlier "star" hack. For example:
*+html p { font-size: 5em; }
This code will be applied in Internet Explorer 7, but not in any other browser. Note that this hack only works in IE7 standards mode; it does not work in quirks mode. This hack is also supported by Internet Explorer 8's compatibility view (IE7 standards mode), but not in IE8 standards mode. Like the star HTML hack, this uses valid CSS
As Marc B mentioned in the comments, it's an IE hack that works because of a mysterious parent element that IE used to employ:
The html element is the root element of the W3C standard DOM, but Internet Explorer versions 4 through 6 include a mysterious parent element.[8] Fully compliant browsers will ignore the * html selector, while IE4-6 will process it normally. This enables rules to be specified for these versions of Internet Explorer which will be ignored by all other browsers. For example, this rule specifies text size in Internet Explorer 4-6, but not in any other browsers.
*
wildcard though? Wouldn't this achieve the same ashtml .news .image{}
?<html>
explicitly since it's a top level singleton element anyways? It's probably some hacked up CSS to work around IE bugs, since IE for some reason has an invisible/unamed element that exists above body/html that* html
would select.* + html
describes impossible situation, becausehtml
node cannot have siblings, since it's a root element in the tree. So this selector makes no sense. All browsers understand it and simply ignore such a weird selector. All but IE7, which due to some bug in parser implementation applies the rule.news .image { .... }
.