I'm being ignored by internet explorer...
February 22, 2008 12:50 PM   Subscribe

I have a web site using Wordpress and I'm trying to figure out a css problem with IE. The first thing I'm doing is creating a seperate IE stylesheet. I've followed all the instructions found in the Wordpress forums but can't seem to get IE to pick up the new stylesheet. (I've already asked this question there but haven't gotten back anything that worked.) Here's what I've added to my header.php *below* the call to the regular style.css: Here's my code: <!--[if IE]> <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/style-ie.css" type="text/css" /> <![endif]--> I know that IE is picking up the if-then, because I added a random text string in there and IE showed it. The way I'm testing whether or not IE is getting the style-ie.css sheet is by changing the color of the menu bar from orange (non-IE) to white (IE). I've also tried hardcoding the path to the other css sheet and that didn't help. I'm at my wits end. What am I doing wrong?
posted by edjusted to Computers & Internet (15 answers total)
 
Response by poster: Oops...let me try again...here's the code:
<!--[if IE]>
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/style-ie.css" type="text/css" />
<![endif]-->
posted by edjusted at 12:59 PM on February 22, 2008


Load the page, view the source, and look at what the evaluated statement looks like. Does it really point to the right place? Can you load the file individually with IE using the path in the delivered page?
posted by splice at 1:14 PM on February 22, 2008


Perhaps your IE-only rules are not specific enough?
posted by Plug Dub In at 1:14 PM on February 22, 2008


One thing to note is that if you want the ie specific styles to override the other ones, this ie hack has to come after the other style declarations. The C in CSS is for cascading, so the declaration closest to the element wins.
posted by advicepig at 1:19 PM on February 22, 2008


Response by poster: splice: yes, when I had the hardcoded path to the css file, I tested it out by cutting n pasting the path into IE. It loaded the file.

Plug Dub & advicepig: in my header.php file, the call to the "universal" style.css file comes before the if-then for the ie-specific style.css. Currently, the regular stylesheet and the ie-specific stylesheet are exactly the same (ie I just copied the file) except I changed a background color tag for testing. I'm a css beginner, but as I understand it, this should work...since the ie stylesheet is called *after* the regular stylesheet?
posted by edjusted at 1:31 PM on February 22, 2008


Yes, if they're pretty much the same style sheet it should work.

I have no idea if IE works this way, but have you tried loading style-ie.css itself in IE, hitting reload, and then reloading the page it's called from? Sometimes things get cached and you need to manually reload them.
posted by Plug Dub In at 1:39 PM on February 22, 2008


Response by poster: Ok, I tried that, and I get the same thing. FWIW I've also cleared cache about a zillion times and even had some friends try loading the page from their computer, and get the same results.

The thing that's frustrating is that as far as I can tell, based on my limited knowledge and following the stuff I've Googled step-by-step, this *should* work!
posted by edjusted at 2:00 PM on February 22, 2008


Can we get a link to the blog? I have had similar problems in the past, I'd like to see it so I can check out the source and see if I spot any problems. :)
posted by jesirose at 2:40 PM on February 22, 2008


Response by poster: Sure, I just didn't wanna seem like I was self-promoting. It's ramenramenramen.net.

I've checked every quotation mark, bracket, etc several times, and I've even retyped the cost from scratch just to make sure I didn't have an unclosed quote or code. It's really mind-boggling.
posted by edjusted at 3:38 PM on February 22, 2008


Did you validate your HTML and CSS?
posted by kirkaracha at 3:39 PM on February 22, 2008


Response by poster: I also just added the words "IE test" to the if-then statement, so you can see the evidence that the if-then *is* working...it's just not picking up the css reference.
posted by edjusted at 3:40 PM on February 22, 2008


Response by poster: And to be really complete, the change in the stylesheets is the background value for #topy is E2B400 (orange) for non-IE, 000000 (white) for IE browsers. #topy is the background color of the horizontal menu bar.
posted by edjusted at 3:43 PM on February 22, 2008


Response by poster: kirkaracha: I did the HTML validation a while ago, fixed major problems, and put off fixing the other problems for later...mainly <br> instead of <br />, and having <li> when it should be something else.

I just tried the CSS validation and it looks like the only problems is with some tags having the same foreground and background colors, but nothing involving the #topy tag.
posted by edjusted at 3:50 PM on February 22, 2008


Best answer: Your problem is you never close the open comment on line 475 of style-ie.css

/* E2B400

All of those menu styles after that line are commented out until it finds a close comment.
posted by ghostmanonsecond at 3:57 PM on February 22, 2008


Response by poster: @#%^@#& I knew it had to be something simple...and lame...

Thanks a million ghostmanonsecond!

Now if only I could figure out why the orange menu bar is so damn thick in IE and no other browser...
posted by edjusted at 4:42 PM on February 22, 2008


« Older “You'll find boredom where there is the absence of...   |   pop-up in my periphery... Newer »
This thread is closed to new comments.