Update: http://code.garyjones.co.uk/enqueued-style-sheet-extras/#ie
Over time, Internet Explorer (IE) is getting better at rendering web pages how we want them, but while IE7 and earlier versions still have a (fast-fading) grip, we sometimes still need to provide exclusive styles to make them render our sites in an acceptable way. That is where conditional style sheets are used.
Open up the functions.php file in your child theme and add the following code. The code should be entered at the end of the file, just before the closing ?> if there is one.
add_action( 'wp_head', 'child_add_ie7_style_sheet', 20 );
/**
* Add a style sheet for IE7 and earlier.
*
* @author Gary Jones
* @link http://code.garyjones.co.uk/ie-conditional-style-sheets/
*/
function child_add_ie7_style_sheet() {
?>
<!--[if lte IE 7]>
<link href="<?php bloginfo( 'stylesheet_directory' ); ?>/style-ie7.css" rel="stylesheet" type="text/css" />
<![endif]-->
<?php
}
This function uses a conditional comment to target only browsers that are less than or equal to (the lte bit) IE7. Other conditional comments are available, but this is by far the most common approach, with IE6- and IE7-specific styles thrown into the same file, to avoid an extra HTTP request. Browsers which aren’t IE just see the above function output as one big comment and promptly ignore it.
We hook the function in with a priority of 20. This make sure it appears after any other style sheets that you or a plugin have added in.