SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist IJoeR's Avatar
    Join Date
    Feb 2003
    Location
    Somewhere in, MD
    Posts
    400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    why doesn't this work?

    This is frustrating me to no end...

    Here is the code I have in my page:

    Code:
     
    <link rel="stylesheet" type="text/css" href="css/layout.css" media="all">
    <link rel="stylesheet" type="text/css" href="css/topnav.css" media="all">
    <!--[if lt IE 7]>
    <link rel="stylesheet" href="css/ie6_layout.css" type="text/css" />
    <![endif]-->
    Basically, all browsers are supposed to load layout.css and topnav.css. IE6 and below is supposed to ie6_layout.css. Its basically the same CSS sheet except I made modifications to about 3 different styles.

    I upload my files and run IE6. For some reason it keeps loading the IE7 style sheet.

    The ie_layout.css has the same style names as layout.css just different attributes. anyone have any idea what i can do to get this thing to load properly?

    The site looks bad in IE6

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    version

    Your snippet doesn't show a specific "IE 7" stylesheet. It shows a "less than IE 7" styleheet, which IE6 is.

  3. #3
    SitePoint Evangelist IJoeR's Avatar
    Join Date
    Feb 2003
    Location
    Somewhere in, MD
    Posts
    400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The very first line, the one calling "layout.css" should be loaded by IE7. Which it does. It works fine in all browsers except IE6 won't load the specific style sheet I've assigned to it.

    Basically, layout.css is for all browsers except IE6. ie6-layout.css is for IE6 and below.

    i feel like there is just super simple that I'm not doing. Can't put my finger on it though.

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    conditional styles

    AFAIK as long as ie6_layout.css is after the others and the same selectors are used, then the latter styles should over-ride the previous ones.
    Although the conditional comment's syntax looks good to me,
    try <!--[if IE 6]> and see if IE 6 then picks it up.
    Or maybe because of the missing media="all", the browser considers it to be of secondary importance?

  5. #5
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You shouldn't need to use a different stylesheet if you design it properly.

  6. #6
    SitePoint Evangelist IJoeR's Avatar
    Join Date
    Feb 2003
    Location
    Somewhere in, MD
    Posts
    400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Mitt for leaving that HELPFUL comment.

    Zif, the site uses a special effect only supported by modern browsers. It won't happen in IE6 because of lack of PNG transparency support so i need to load another style sheet to override the style that calls the png as a background image and replace it with a new background image -- a plain old JPG.

    So, this was a choice I made when i programmed the site.


Bookmarks

Posting Permissions

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