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:

    I am firmly opposed to the government entering into any business the major purpose of which is competition with our citizens ... for the Federal Government deliberately to go out to build up and expand ... a power and manufacturing business is to break down the initiative and enterprise of the American people; it is the destruction of equality of opportunity amongst our people, it is the negation of the ideals upon which our civilization has been based.
    Herbert Hoover (1874–1964)

    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)