Do you think it’s better or worse or makes no difference whether I reference a different style sheet altogether or import the IE styles into my main css file?
If you import them into your main stylesheet then every browser is going to apply that styling. The point of this is to have only IE browsers apply styling. You can’t use the conditional tags within a CSS file as they are HTML comments.
I question if I import and I keep this code as is in my header:
<link rel=”stylesheet” type=”text/css” href=”<?php bloginfo(‘stylesheet_url’); ?>” /> does it still know about IE. Or do I past this in front of it <!–[if lte IE 7]>
The way it is intended to be used is, the main stylesheet applies to ALL browsers, including IE. The ie stylesheet follows the main stylesheet in the header declarations, and it does not contain all the styling, just the tweaks that IE needs. The way CSS works is when two stylesheets apply styling to the same page element, the styling in the last stylesheet declared overrides the styling in stylesheets declared earlier in the page load process.
IE conditional stylesheets are typically very short, do not duplicate the entire site’s stylesheet, contain only the few tweaks necessary to get IE to behave as desired.
Also if I put this line of code in my header.php it’s grayed out, is that right?
<!–[if IE 7]> <link rel=”stylesheet” type=”text/css” href=”IE7styles.css” /><![endif]–>
<!–[if lte IE 7]>
<link rel=”stylesheet” type=”text/css” href=”<?php bloginfo(‘template_url’); ?>/ie7.css” media=”screen” />
Again, IE conditional comments are a special form of HTML comments. All browsers other than IE see them as comments and thus they are greyed out. Even IE sees them as comments, but it takes action on what is contained in those comments when it sees the [if IE7] contained within the comment. So even in IE it will appear greyed out, but IE acts on it anyway.