Here’s how to implement Paul Irish’s solution for conditional IE CSS classes for the html
tag in Genesis.
/** Conditional html element classes */ remove_action( 'genesis_doctype', 'genesis_do_doctype' ); add_action( 'genesis_doctype', 'child_do_doctype' ); function child_do_doctype() { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!--[if lt IE 7 ]> <html class="ie6" xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes( 'xhtml' ); ?>> <![endif]--> <!--[if IE 7 ]> <html class="ie7" xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes( 'xhtml' ); ?>> <![endif]--> <!--[if IE 8 ]> <html class="ie8" xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes( 'xhtml' ); ?>> <![endif]--> <!--[if IE 9 ]> <html class="ie9" xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes( 'xhtml' ); ?>> <![endif]--> <!--[if (gt IE 9)|!(IE)]><!--> <html class="" xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes( 'xhtml' ); ?>> <!--<![endif]--> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" /> <?php }
Now you can easily target IE in your CSS like so:
div.foo { color: inherit;} .ie6 div.foo { color: #ff8000; }
Simple huh?
You really have saved me a headache with this snippet today !!! Thank you so much for putting this out there ; )