Resolving Browser Display Discrepancies Between IE and Firefox

IE and Firefox browsers have CSS discrepanciesWhen you begin modifying your blog’s stylesheet or designing your own blog, you may notice that some elements display differently in Internet Explorer (IE) than they do in Firefox. IE is usually the problematic browser, and it’s hard to say why there are so many CSS display quirks and bugs from Microsoft. But there is a quick, easy fix around the troubling display discrepancies.

In short, you create two stylesheets, one for IE and one for Firefox and other browsers. You then add a piece of code in your header that tells to the IE browser to read the IE style sheet. The other browsers will read the other stylesheet.

To create separate stylesheets for the different browsers:

1. Duplicate your current stylesheet and change the name to something like ie7.css.

2. In your header file, locate the current call to your stylesheet. It should look something like this:
<style type=”text/css” media=”screen”> @import
url( <?php bloginfo(‘stylesheet_url’); ?> );
Delete this call to your style sheet.

3. In the place where you deleted the style sheet call, add this code instead:
<![if IE]><link rel=”stylesheet” type=”text/css”

<![if !IE]><link rel=”stylesheet” type=”text/css”
4. Customize the paths to your style sheets. The first code snippet says, if the browser is IE, use the ie7.css stylesheet. The second code snippet says, if the browser is not IE, use the style.css stylesheet.

With this method, you have two style sheets to maintain, so keep this in mind when making updates. However, you’ll be able to easily adjust the styles for the troublesome IE browser.

Additional Resources

Adobe RobohelpMadcap Flare

This entry was posted in general, web design, WordPress on by .

By Tom Johnson

I'm a technical writer working for the 41st Parameter in San Jose, California. I'm interested in topics related to technical writing, such as visual communication, API documentation, information architecture, web publishing, JavaScript, front-end design, content strategy, Jekyll, and more. Feel free to contact me with any questions.

11 thoughts on “Resolving Browser Display Discrepancies Between IE and Firefox

  1. Pingback: Oracle by Madrid

  2. Steve Thompson

    Your article states “The other browsers will read the OTHER stylesheet.” This is not quite so.

    I experimented with two spreadsheets that contained simple styling – different colours for H1 and P elements. To the first (IE)stylesheet, I added another line: BODY { background-color: gray; }

    In the non-IE browser,I saw a grey background! I expected the usual white background.

    What happens is that a non-IE browser cannot under the IF lines so it runs BOTH stylesheets, one after the other.

    To make this feature work, both stylesheets must define each style. For example, if one stylesheet defines the format of an H2, the other one must too.

  3. Kristen Brooke Beck

    Ahhh, good point. I’ve always defined the format for the same selectors on each stylesheet, so I’ve never had the non-IE browser pick up any property values for the IE selectors. I think I’ll play with that a bit and update my article with the new results. Thanks.

  4. Pingback: Core Dump

  5. Pingback: Create 2 stylesheets (IE & Firefox) in Wordpress |

  6. Jim Somchai

    Hi David,

    Thanks for the useful post you have here.

    However, I learned by accident that the change in code can not be done since some of the symbols shown on your site has been modified. Here are what I found:

    Old code on header:

    <link rel=”stylesheet” href=”” type=”text/css” media=”screen” />

    Change to

    XXX is the name of the site.
    YYY is the theme you use.

    You may want to edit the code so that it can be useful to others. Anyway, I appreciate the contents on your site.


    Jim Somchai,

    Jim Somchais last blog post..How To Fix WordPress Blog That Shows Differently on IE and Firefox


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>