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:

    Michelangelo said to Pope Julius II, “Self negation is noble, self-culture is beneficent, self-possession is manly, but to the truly great and inspiring soul they are poor and tame compared to self-abuse.” Mr. Brown, here, in one of his latest and most graceful poems refers to it in an eloquent line which is destined to live to the end of time—”None know it but to love it, None name it but to praise.”
    Mark Twain [Samuel Langhorne Clemens] (1835–1910)

    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)