Connecting Tech Pros Worldwide Forums | Help | Site Map

IE6 z-index problems

pezholio's Avatar
Newbie
 
Join Date: Jun 2007
Posts: 22
#1: Aug 18 '08
Hi,

I'm getting ready to launch a new design for a site I've been working on. The homepage has three columns and I wanted to change the reading order so the middle column came first. I've done a bit of trickery with padding and positioning and all works fine in proper browsers, unfortunately in IE6 the left column is invisible:

http://www.ratemyplace.org.uk/newsite/index.php

I've tried to rectify this by setting a z-index, but IE6 steadfastly refuses to show it! Any ideas?

Cheers

Newbie
 
Join Date: Aug 2008
Posts: 2
#2: Aug 18 '08

re: IE6 z-index problems


float: left;
width: 190px;
margin-right: 10px;
position: absolute;
left: 0;
top: 10px;
z-index: 999;
}

I don't know if there is a work around for IE6 and 3 columns, but I do know that float does not work with absolute postioning. If you Google IE6 and 3 columns you get a slew of hits on it. It could be your container space is too small in IE6 due to margins and padding. Try doing a css body with 0 margin and 0 padding and use a IE6 only style sheet or increasing the width of the container.
Expert
 
Join Date: Aug 2008
Posts: 397
#3: Aug 18 '08

re: IE6 z-index problems


The below brings the left col up in IE/6. IE/7, and compliant browsers hold. I left the tweaking of the right col to you-- it /may/ need a negative backside margin to pull it a little more to the right...


Try it as a cross-browser test run replacing your selectors #middle, #left, #right, and #main with these, and see what you think:

Expand|Select|Wrap|Line Numbers
  1. #middle
  2.     {
  3.     float: left;
  4.     width: 550px;
  5.     margin-left: 200px;
  6.     }
  7. * html #middle
  8.     {
  9.     display: inline;
  10.     }
  11. #left    {
  12.     float: left;
  13.     width: 200px;
  14.     margin-left: -750px;
  15.     }
  16. #right
  17.     {
  18.     float: left;
  19.     width: 200px;
  20.     }
  21. #main
  22.     {
  23.     width: 950px;float:left;
  24.     }
  25.  
  26. /* easy clearing */
  27. #main:after
  28.     {
  29.     content: '.'; 
  30.     display: block; 
  31.     height: 0; 
  32.     clear: both; 
  33.     visibility: hidden;
  34.     }
  35. #main
  36.     {
  37.     display: inline-block;
  38.     }
  39. /*\*/
  40. #main    {
  41.     display: block;
  42.     }
  43. /* end easy clearing */
  44.  
  45.  
pezholio's Avatar
Newbie
 
Join Date: Jun 2007
Posts: 22
#4: Aug 19 '08

re: IE6 z-index problems


That's perfect thanks. I used relative positioning to pull the right column 10 pixels to the right and it looks great in all browsers. Thanks a lot! :)
Reply