www.webdeveloper.com
Results 1 to 11 of 11

Thread: Wxternal CSS for different browsers

Hybrid View

  1. #1
    Join Date
    Feb 2009
    Posts
    32

    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:

    Code:
    <link rel="stylesheet" type="text/css" href="style.css"> 
    <!--[if IE 7]>
        <link rel="stylesheet" type="text/css" href="style_ie7.css" />
    <![endif]-->
    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.

    Can anyone please help?

  2. #2
    Join Date
    Jun 2009
    Posts
    112
    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...

  3. #3
    Join Date
    Feb 2009
    Posts
    32
    Hi peachskittle

    No I have not yet resolved my problem. In addition to this, a Browser Compatability test in Dreamweaver concludes:

    Line 21

    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.

  4. #4
    Join Date
    Jun 2009
    Posts
    112
    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?

  5. #5
    Join Date
    Feb 2009
    Posts
    32
    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??

  6. #6
    Join Date
    Jun 2009
    Posts
    112
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles