CSS Filter - Negation Pseudo-class Hack

Negation Pseudo-class Hack

Internet Explorer 8 and below do not support the CSS3 :not negation pseudo-class. Internet Explorer 9 added support for CSS3 pseudo-classes including the negation pseudo-class.

.yourSelector { color: black; /* value for IE 8 and below */ } html:not .yourSelector { color: red; /* value for Chrome, Safari, Opera, Firefox, and IE9+ */ }

The negation pseudo-class accepts any simple selector: A type selector, universal selector, attribute selector, class selector, ID selector, or pseudo-class. (excluding pseudo-elements and the negation pseudo-class itself). It then applies the following properties to all elements which do not match this argument. Note that the ie8andbelow selector has no meaning, it is simply a string that will never match an actual selector. The string dummy would work equally as well.

A variation of this hack uses the :root pseudo-class, which is also unrecognized by Internet Explorer 8 and below.

Read more about this topic:  CSS Filter

Famous quotes containing the words negation and/or hack:

    An “unemployed” existence is a worse negation of life than death itself.
    José Ortega Y Gasset (1883–1955)

    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)