Wxternal CSS for different browsers
Hi, I've developed a stylesheet for my website that works great in both FF and Safari, but IE7 is showing errors in spacing.
I've made an adjusted version of the stylesheet and included this code on all HTML pages:
The problem is that IE7 seems to ignore this command and calls from style.css, not style_ie7.css - thus showing the same spacing errors.
<link rel="stylesheet" type="text/css" href="style.css">
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style_ie7.css" />
Can anyone please help?
Hiya, not sure if you've resolved this already.
The conditional you have there for IE7 works just as it should for me. I think this may not be your problem...
No I have not yet resolved my problem. In addition to this, a Browser Compatability test in Dreamweaver concludes:
Found 1 errors in external css files
Affects: Internet Explorer 6.0, 7.0; Internet Explorer for Macintosh 5.2; Netscape 8.0; Opera 8.0, 9.0; Safari 2.0
****line 21 = <link rel="stylesheet" type="text/css" href="style.css"> ***
Actually scratch that, I've solved the error found by Browser Checker - however I am still having the IE7 stylesheet issue. The default stylesheet seems to load everytime...
Last edited by andidas311; 06-05-2009 at 10:34 AM.
The conditional doesn't stop the page from loading the standard stylesheet, but it should also load the IE stylesheet when in IE7 since IE7 is the only one that should see the command to do that. Is it loading both?
I've conducted a few experiments and found that yes IE7 is calling the IE7 style sheet, BUT, for some reason, any adjustments I make to the margin/padding etc. in the non-IE7stylesheet are also appearing when previewed in IE7
How can that be? is it reading both stylesheets at once??
I guess that's what I was trying to say, yes. The IE 7 conditional isn't tell the page to use the ie7 stylesheet instead. It's telling IE7, and IE7 only, to use the ie7 stylesheet alongside your main stylesheet. It is definitely possible for IE7 to still respect the main stylesheet over your IE7 one, so you may need to either be more specific about what style you are trying to feed to ie7. I think you're having more of an issue with your style than with including the file, as it looks like you're doing that fine.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread