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
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html>
- <head>
- <style>
- .menu ul {
- width: 8em;
- background; #edc#
- border-top: 1px solid #000;
- padding:0; margin:0; list-style-type: none; float:left;
- }
- .menu li {
- list-style: none;
- position: relative;
- border-left: 1px solid #000;
- border-right: 1px solid #000;
- border-bottom: 1px solid #000;
- vertical-align: bottom;
- }
- .menu ul a {
- display:block;
- padding: 5px 1px;
- vertical-align: bottom;
- }
- .menu ul ul {
- background: #fed;
- position: absolute;
- left: -300px;
- }
- .menu ul li:hover ul {
- left:7em;
- top: 4px;
- z-index: 100;
- font-size:9px; display:block; position:absolute; top:0; left:145px; width:145px;
- }
- .menu { margin:0; margin:0px 0; font-size: 9px; }
- .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; }
- .menu ul li {padding:0; clear: both; float:left; margin-right:1px; }
- .menu ul li ul { display: none; }
- /* Non IE attributes */
- .menu ul li:hover a { color:#00f; background:#b3ab79; }
- .menu ul li:hover ul li a:hover { background:#c9c9a7; color:#00f; }
- </style>
- <!-- Taken from http://www.positioniseverything.net/ -->
- <!--[if IE]>
- <style type="text/css">
- body {behavior: url(csshover.htc);}
- ul a, ul, li {height: 1%;} /* Holly hack fix for IE bugs */
- li {
- margin-left: -16px;
- mar\gin-left: 0;
- } /* special rules to correct older IE/win bullet zone problems */
- </style>
- <noscript>
- <style type="text/css">
- ul ul {position: static;}
- </style>
- </noscript>
- <![endif]-->
- <style>
- #Col1 {
- position:absolute;
- width: 200px;
- left: 100px;
- }
- #Col2 {
- position:absolute;
- width: 200px;
- left: 250px;
- }
- </style>
- </head>
- <body>
- <div class='menu'>
- <div id='Col1'>
- <ul>
- <li style='z-index:10;' > <a href='#'>One</a>
- <ul>
- <li style='z-index:7;'><a href='#'>Here</a></li>
- <li><a href='#'>There</a></li>
- <li><a href='#'>Everywhere</a></li>
- </ul>
- </li>
- <li style='z-index:9;' > <a href='#'>Two</a>
- <ul>
- <li><a href='#'>Here</a></li>
- <li><a href='#'>There</a></li>
- <li><a href='#'>Everywhere</a></li>
- </ul>
- </li>
- </ul>
- </div> <!-- eo 'Col1' -->
- <div id='Col2'>
- <ul>
- <li style='z-index:8;' > <a href='#'>Three</a>
- <ul>
- <li><a href='#'>Here</a></li>
- <li><a href='#'>There</a></li>
- <li><a href='#'>Everywhere</a></li>
- </ul>
- </li>
- <li style='z-index:7;' > <a href='#'>Four</a>
- <ul>
- <li><a href='#'>Here</a></li>
- <li><a href='#'>There</a></li>
- <li><a href='#'>Everywhere</a></li>
- </ul>
- </li>
- </ul>
- </div> <!-- eo 'Col2' -->
- </div> <!-- eo 'menu' -->
- </body>
- </html>
TIA