what does "+" mean in CSS?
.competence{+line-height:20px;}
I know with * is a开发者_Python百科 CSS hack for IE. Only IE7 and below http://www.javascriptkit.com/dhtmltutors/csshacks3.shtml
I want to know what does "+" mean?
thanks for help :)
From the site you linked to: http://www.javascriptkit.com/dhtmltutors/csshacks3.shtml
Although Internet Explorer 7 corrected its behavior when a property name is prefixed with an underscore or a hyphen, other non-alphanumeric character prefixes are treated as they were in IE6.
The +
character counts as "other non-alphanumeric character" and therefore it would be "treated as they were in IE6".
I'd guess that it's a variant of the *
hack (*property: value
).
The more conventional use of +
is in selectors: see the w3c for details.
Adjacent sibling selectors have the following syntax: E1 + E2, where E2 is the subject of the selector. The selector matches if E1 and E2 share the same parent in the document tree and E1 immediately precedes E2, ignoring non-element nodes (such as text nodes and comments).
Thus, the following rule states that when a P element immediately follows a MATH element, it should not be indented:
math + p { text-indent: 0 }
精彩评论