473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

z-index issue on css menu flyout (in IE6)

Hi all,

I am using IE6, and have a problem with css (nearly) only flyout menus. In firefox, it works fine, but in IE6 with the csshover.htc behaviour, I am finding that the 2nd level menu items are being hidden behind other menu items. I have set the 2nd level items to have a high z-index to no avail. Code below:

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2.  
  3. <html>
  4.   <head>
  5.     <style>
  6.       .menu ul {
  7.         width: 8em;
  8.         background; #edc#
  9.         border-top: 1px solid #000;
  10.  
  11.          padding:0; margin:0; list-style-type: none; float:left;
  12.       }
  13.  
  14.       .menu li {
  15.         list-style: none;
  16.         position: relative;
  17.         border-left: 1px solid #000;
  18.         border-right: 1px solid #000;
  19.         border-bottom: 1px solid #000;
  20.         vertical-align: bottom;
  21.       }
  22.  
  23.       .menu ul a {
  24.         display:block;
  25.         padding: 5px 1px;
  26.         vertical-align: bottom;
  27.       }
  28.  
  29.       .menu ul ul {
  30.         background: #fed;
  31.         position: absolute;
  32.         left: -300px;
  33.       }
  34.  
  35.       .menu ul li:hover ul {
  36.         left:7em;
  37.         top: 4px;
  38.  
  39.         z-index: 100;
  40.         font-size:9px; display:block; position:absolute; top:0; left:145px; width:145px;
  41.       }
  42.     .menu {  margin:0; margin:0px 0; font-size: 9px; }
  43.     .menu ul li a, .menu ul li a:visited { font-size:9px; display:block; text-decoration:underline; color:#00f; width:144px; text-align:center; border:1px solid #fff; border-width:1px 1px 0 0; background:#c9c9a7; border:outset 2px #ddd; }
  44.     .menu ul li {padding:0; clear: both; float:left; margin-right:1px; }
  45.     .menu ul li ul { display: none; }
  46.     /* Non IE attributes */
  47.     .menu ul li:hover a { color:#00f; background:#b3ab79; }
  48.     .menu ul li:hover ul li a:hover { background:#c9c9a7; color:#00f; }
  49.  
  50.     </style>
  51. <!-- Taken from http://www.positioniseverything.net/ -->
  52. <!--[if IE]>
  53.   <style type="text/css">
  54.     body {behavior: url(csshover.htc);}
  55.     ul a, ul, li {height: 1%;} /* Holly hack fix for IE bugs */
  56.     li {
  57.       margin-left: -16px;
  58.       mar\gin-left: 0;
  59.     } /* special rules to correct older IE/win bullet zone problems */
  60.   </style>
  61.  
  62.   <noscript>
  63.     <style type="text/css">
  64.       ul ul {position: static;}
  65.     </style>
  66.   </noscript>
  67.  
  68. <![endif]-->
  69.  
  70. <style>
  71.   #Col1 {
  72.     position:absolute;
  73.     width: 200px;
  74.     left: 100px;
  75.   }
  76.   #Col2 {
  77.     position:absolute;
  78.     width: 200px;
  79.     left: 250px;
  80.   }
  81. </style>
  82.  
  83.   </head>
  84.  
  85.   <body>
  86.     <div class='menu'>
  87.       <div id='Col1'>
  88.         <ul>
  89.           <li style='z-index:10;' > <a href='#'>One</a>
  90.             <ul>
  91.               <li style='z-index:7;'><a href='#'>Here</a></li>
  92.               <li><a href='#'>There</a></li>
  93.               <li><a href='#'>Everywhere</a></li>
  94.             </ul>
  95.           </li>
  96.           <li style='z-index:9;' > <a href='#'>Two</a>
  97.             <ul>
  98.               <li><a href='#'>Here</a></li>
  99.               <li><a href='#'>There</a></li>
  100.               <li><a href='#'>Everywhere</a></li>
  101.             </ul>
  102.         </li>
  103.       </ul>
  104.     </div> <!-- eo 'Col1' -->
  105.     <div id='Col2'>
  106.       <ul>
  107.         <li style='z-index:8;' > <a href='#'>Three</a>
  108.           <ul>
  109.             <li><a href='#'>Here</a></li>
  110.             <li><a href='#'>There</a></li>
  111.             <li><a href='#'>Everywhere</a></li>
  112.           </ul>
  113.         </li>
  114.         <li style='z-index:7;' > <a href='#'>Four</a>
  115.           <ul>
  116.             <li><a href='#'>Here</a></li>
  117.             <li><a href='#'>There</a></li>
  118.             <li><a href='#'>Everywhere</a></li>
  119.           </ul>
  120.         </li>
  121.       </ul>
  122.     </div> <!-- eo 'Col2' -->
  123.   </div> <!-- eo 'menu' -->
  124. </body>
  125. </html>
  126.  
  127.  
I have read that IE6 has z-index issues, but I am at a loss as to how to fix.

TIA
Jul 25 '08 #1
2 2094
tharden3
916 512MB
Now I'm not sure... and Google could help you with this... but there is probably a function of 'display' that you could use to make it show itself on top. Again, IE always has problems.... I would google some things you can do with display.

P.S.
I can't quite understand why that z-indexing won't work like it should.
Jul 25 '08 #2
tharden3
916 512MB
Now I'm not sure... and Google could help you with this... but there is probably a function of 'display' that you could use to make it show itself on top. Again, IE always has problems.... I would google some things you can do with display.

P.S.
I can't quite understand why that z-indexing won't work like it should.
Scratch what I said, I looked up all the possible 'display' features. None would be helpful to your problem. I though that maybe because you can make objects disappear with "display: none;" that you might be able to make them appear exclusively on top. But you can't.... I'll keep looking into your problem.
Jul 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Abs | last post by:
Hi! I'm building a website for some friends in a independent game developing group. The site is almost done but I've come across a bug that only happens in IE6 (I've tested the site with the...
0
by: Jeroen Sangers | last post by:
Hello, I am having a problem in IE with my menu tabs. I want them to appear alligned on the bottom of my header, and therefore I have positioned my header relatively to set a positioning...
4
by: Philippe | last post by:
Hello, I'm a newbee into the javascript world and I'm trying to use the opencube solution to display a complex menu. As I can see, the opencube solution is javascript 1.2. My menu is working...
3
by: Mario Schymura | last post by:
Hi everybody. I want to add a new Menu to IE6. I'll use C# and the .NET Framework 1.1 to develop it, but my problem is leck of knowledge concerning IE6 programming. Which Object Model (classes)...
1
by: Richard | last post by:
A menu page has a set of A tages in a UL The menu (in IE) will only get the hover visualization if the mouse rolls over underlined text. I want it to happen if the rollover occurs anywhere in...
0
by: Jack Gray | last post by:
Hi everyone, I am using a nested list for a simple drop-down menu. All CSS and XHTML validate. The menu is displayed properly in 7 different newer browsers including IE7, Firefox, Opera & Safari....
1
by: raghuvarmabh | last post by:
I am generating dynamic menu using css.the menus are loaded from data base at start up.But i am having some serious problems. 1.The menu is unable to roll over select boxes in IE6.This is very...
2
by: elasticgurl | last post by:
I'm wondering if anyone has access to ie6 and can view my css and see if they can help me . As it stands, my menu looks different in both mac browsers and IE6. At this point, I haven't tested in...
5
by: jerry101 | last post by:
Hi, I've been working on a horizontal drop down menu today, and I can get it to display perfectly in everything bar IE6. Basically instead of them lining up horizontally, they line up...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.