SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    Athens
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can't hide malfunctioning image from IE6 with conditional comment

    Greetings,

    I have found that a small graphic located at the bottom of my site's homepage right sidebar shifts out of the sidebar to the left main content region in IE6 only. At this point, I'm just trying to hide it from IE6 instead of trying to make it work. So...

    I created a conditional comment in the head:
    Code:
    <!--[if IE6]>
    <link rel="stylesheet" type="text/css" href="http://www.magpiemosaics.com/fb/includes/css/ie6.css" />
    <![endif]-->
    Created ie6.css with a single style:
    .IE6_imgFix { display: none; }

    And then attempted to apply the class style (class="IE6_imgFix") to the image tag (I also attempted to apply it to the surrounding div when that wouldn't work, changing the style name to .IE6_imgFix img)

    For some reason, the image still shows in IE6.

    I greatly appreciate any advice!

    http://www.magpiemosaics.com/fb
    Last edited by krycielo; Sep 13, 2007 at 16:10.

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to put a space between "IE" and "6" in the condition portion of the conditional comment.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hard to say working online, but to actually fix the problem, try adding position:relative; to either the #sidebarBox div or the div surrounding the image. I don't think an extra stylesheet will be necessary for this.

  4. #4
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure exactly which one is causing the problem, but this seems to fix it:

    * html #sidebar div { height: 1&#37; }


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
  •