Results 1 to 6 of 6

Thread: Div tag settings not working in IE6

  1. #1
    Join Date
    Sep 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Div tag settings not working in IE6

    I've got an image placed inside a div tag where the div is set to a height and width of 100%. The div has a "fixed" position with a "left" value set to "-36px", which ensure's it shows up exactly where I want it to. Everything that I setup in the style sheet works fine with Firefox 1.5x; the problem - big surprise - is that it doesn't work at all in IE6.

    Basically what's happening in IE is that the scroll bars are still showing up (which I don't want to happen) and it doesn't appear to be recognising the negative-positioning either.

    I'm just now learning to use div tags so there's probably some trick I haven't figured out yet. Here's the code I'm using.
    Code:
    <style type="text/css">
    <!--
    body, html {
    	height: 100%;
    	margin: 0;
    	padding: 0;
    	background-color: #566f5f;
    	background-image: url(images/bg.gif);
    	background-repeat: repeat-x;
    	text-align: center;
    }
    #myTable {
    	width: 100%;
    	height: 100%;
    	margin: 0;
    	padding: 0;
    	position: fixed;
    	left: -36px;
    }
    -->
    </style>
    </head>
    
    
    <body>
    <div id="myTable"><img src="images/picture.jpg" width="1071" height="738" border="0" usemap="#Map" />
    <map name="Map" id="Map">
    <area shape="poly" coords="812,437,828,463,1038,409,1018,390" href="mailto:info@email_address.com" alt="Contact Us" />
    </map></div>
    As I mentioned, it works great in FF but not in IE. If anyone has any ideas or suggestions it would be a massive help

    Thanks!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    height:100&#37;; is usually meaningless. position:fixed; isn't supported in IE prior to IE 7. With no position that it recognizes as valid, IE 6 and less will not use left: -36px;. Depending upon your layout, position absolute can sometimes 'stand in' for fixed (it probably won't look the same but, may be acceptable). To do this only for IE 6 and less:

    Code:
    <style type="text/css">
    body, html {
    	margin: 0;
    	padding: 0;
    	background-color: #566f5f;
    	background-image: url(images/bg.gif);
    	background-repeat: repeat-x;
    	text-align: center;
    }
    #myTable {
    	width: 100%;
    	margin: 0;
    	padding: 0;
    	position: fixed;
    	left: -36px;
    }
    </style>
    <!--[if lte IE 6]>
    <style type="text/css">
    #myTable {
    	position: absolute;
    }
    </style>
    <![endif]-->
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    left: -36px;
    Hmm... Are you allowed to use negative pixel values?
    - Mike

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by mburt View Post
    Hmm... Are you allowed to use negative pixel values?
    I am, your not. Actually, there are situations where they are essentially meaningless either due to a lack of support in a particular browser and/or because there may just be no way to apply them logically to the style property in question. All modern browsers do support them for the left, right, top and bottom properties with position set to other than static, if supported. Negative margins are also pretty much universally supported in the modern browser. With padding, it isn't so universal and with something like width, it wouldn't make sense.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Okay, I think I understand...

    I am, your not
    Your as in, possesive "your"? I think you mean "you're"
    - Mike

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Maybe I meant:

    I am your not.

    Either way, it was a joke and a conceited one at that. Pass it through the Googlator and see what you come up with. Kind of like a negative width.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •