WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to comment out background image in Internet Explorer (8 posts)

  1. TraciBunkers
    Member
    Posted 2 years ago #

    I just found out that my blog isn't displaying correctly in Internet Explorer (but it's fine in all other browsers). The body & sidebars should be on top of white, with an image around the outer edge of the container. In IE, the only white is in the header, and the body & side bar text is on top of the background image, making it hard to read. But the sidebars are in the correct position. Maybe the outer wrapper isn't showing in IE? I have it as white.

    I thought the easiest solution would be to eliminate the background when viewing with Internet Explorer, so it would just be white. I have tried commenting out the background image, but either have done it in the wrong place, or don't know how to do it properly. I also tried adding in a style sheet just for IE with no background image, but no luck with that--I might not be adding the link to that in the correct place or doing something wrong. I don't know what version of IE the person was using who told me about the problem. I'm on a mac, so can't really test it. But I have an old PC with IE8 on it, and was experimenting with that.

    My blog is http://www.TraciBunkers.com/blog

    Any help is appreciated!

  2. Harry
    Member
    Posted 2 years ago #

    Here is how to target all versions of IE with Conditional Comments (only recognised by IE)

    <!--[if IE ]>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/ie.css" type="text/css" media="screen" />
    <![endif]-->

    You could create an ie.css and add any relevant CSS you have there.

    Hope that fixes your issue.

  3. TraciBunkers
    Member
    Posted 2 years ago #

    harmck: thanks for the fast reply! Where do I paste the code & which file?

  4. Harry
    Member
    Posted 2 years ago #

    Try your header.php in your theme.

    Ideally put it directly after this line:

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?> " type="text/css" />

    Create ie.css in the same directory where style.css exists.

  5. TraciBunkers
    Member
    Posted 2 years ago #

    harmck: It worked! I pasted it in the header.php file. For anyone else needing help on this, I pasted it right under this:<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

    I tried to do what you gave me for the code, but didn't quite have it. Thank you so much! I've been messing with it ALL day!

  6. TraciBunkers
    Member
    Posted 2 years ago #

    We were typing at the same time. Glad to see I put it in the right place. Thanks again!

  7. Harry
    Member
    Posted 2 years ago #

    Cool, mark this as resolved if you're happy the problem is fixed. It's the drop down in the right sidebar of this thread.

    Good luck in the future!

  8. TraciBunkers
    Member
    Posted 2 years ago #

    Will do. Wish I had posted my question hours ago! I think I lost some hair in the process. Wouldn't have been so bad if my old PC wasn't slower than death on crutches.

Topic Closed

This topic has been closed to new replies.

About this Topic