Target Firefox, IE 6, IE 7 and IE 8 Separately

Here’s how to target all of these browsers each with their own styles:


p {
color: blue; All browsers
color:red\9; IE6, 7, 8 only (Has to come before the other IE hacks for inheritance to work)
/color:green; IE6, 7 only (Has to come before the IE6 hack for inheritance to work)
_color:yellow; IE 6 only
}

p, x:-moz-any-link { Firefox only
color:black;
}

Additionally, here’s how to target IE 6 and 7 together:

p {
*color:black;
}

This entry was posted in Browsers, CSS, Code Snippets, IE6, Web Design and tagged , , , , . Bookmark the permalink.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>