[Resolved] How to comment out background image in Internet Explorer
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!
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.
harmck: thanks for the fast reply! Where do I paste the code & which file?
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.
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!
We were typing at the same time. Glad to see I put it in the right place. Thanks again!
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!
- The topic ‘[Resolved] How to comment out background image in Internet Explorer’ is closed to new replies.