CSS Filter - Child Selector Hack

Child Selector Hack

Internet Explorer 6 and earlier do not support the "child selector" (>), allowing rules to be specified for all other browsers. For example, this rule will turn paragraph text blue in Firefox, but not in IE before version 7.

html > body p { color: blue; }

Although IE7 added support for the child selector, a variation of the hack has been discovered which allows Internet Explorer 7 to be excluded as well. When an empty comment occurs immediately after the child selector, IE7 will drop the rule that follows, as will earlier versions of IE.

html >/**/ body p { color: blue; }

Read more about this topic:  CSS Filter

Famous quotes containing the words child and/or hack:

    “Just as men must give up economic control when their wives share the responsibility for the family’s financial well-being, women must give up exclusive parental control when their husbands assume more responsibility for child care.”
    —Augustus Y. Napier (20th century)

    “Painting consumes labour not disproportionate to its effect; but a fellow will hack half a year at a block of marble to make something in stone that hardly resembles a man. The value of statuary is owing to its difficulty. You would not value the finest head cut upon a carrot.”
    —Samuel Johnson (1709–1784)