Internet Explorer Filters

Internet Explorer Filters are a pure CSS implementation that, when used in conjunction with the HTML5 Boilerplate <html> conditional comments, requires no hacks and (almost) validates perfectly!

Note that this CSS will not validate because filter is invalid. If validation is important to you, this could be served via an IE-only stylesheet.

There are two separate IE filters that handle opacity, one for IE6 and 7, and another for IE8. (Scrapped the -ms-filter… who needs it?)

#example1 { background: url('../../wp-content/themes/practicalcss3/bg-pattern.jpg'); }
#example1 p {
	background: rgb(81,57,61); /* always have a non-alpha color, just in case */
	background: rgba(123,123,123,.5); /* Everything except IE */
html.lte8 #example1 p {
	background: none; /* the filters require the background to be none */
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7F7B7B7B,endColorstr=#7F7B7B7B); /* IE6-8 */
	zoom: 1; /* 'hasLayout' required for filters */

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Leave a Reply

Your email address will not be published. Required fields are marked *