Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

IE6 Positioning/Z-Index Problem

Featured Replies

Hi everyone,

 

I'm usually pretty stubborn when I run into problems about sorting it out myself but this time I think I'm beaten and I can't afford to waste any more time on it.

 

I have a dropdown menu with a couple of sweet little jquery scripts running on it but for the life of me I cannot get the dropdown menu to show on internet explorer 6. I've tested without javascript and still no luck so I'm certain it's a CSS problem - probably something to do with positioning or z-index.

 

Here's the HTML:

 

<ul class="nav">
<li><a href="#">About</a></li>
<li><a href="#">Services</a>

<ul><li><a href="#">Business Start-Up</a></li>
<li><a href="#">Corporate Tax Planning</a></li>
<li><a href="#">Payroll</a></li>
<li><a href="#">Self Assessment</a></li>
<li><a href="#">VAT</a></li>
</ul></li>

<li><a href="#">Contact</a></li>
</ul>

 

and here's the CSS:

 

.nav {
float: right;
height: 100%;
width: 67%;
}

.nav li {
background: #fff url(../img/nav-button.png) no-repeat top left;
font-variant: small-caps;
float: left;
height: 100%;
overflow: hidden;
width: 33.3%;
}

.nav li ul {
background: transparent url(../img/trans.png);
font-size: 0.60em;
left: -4444px;
position: absolute;
width: 198px;
z-index: 100;
}

.nav li:hover ul {
left: auto;
}

 

The link for the live work in progress is jolora.co.uk/livingstones

 

Any help at all will be really appreciated! Thanks... :-)

I use a csshover.htc behavior file from here for IE6

http://www.xs4all.nl/~peterned/csshover.html

near the bottom, I have Version 1.42.060206 which I have used for a long time but there is a Version 3.11 (:hover, :active and :focus) now which should work the same way. Put it in the same directory as the html file.

 

It needs to be linked in the IE6 conditional comment. I tried for a long time and found that your IE6 conditional comment wasn't working so I re-typed it as the last item before the </head> tag:-

 

<!--[if ie 6]>

<link type="text/css" rel="stylesheet" href="http://www.jolora.co.uk/livingstones/css/ie6.css" />

<script src="http://www.jolora.co.uk/livingstones/js/png-fix.js"></script>

<script>

DD_belatedPNG.fix('#tel, #email, #post, .container, #aside-bottom, h1, #searchform label');

</script>

<style type="text/css">

body {behavior:url(csshover.htc);}

.nav li ul li { background: green; }/*just to test IE6*/

</style><![endif]-->

 

and it worked in IE6; it's now being processed after all the alternative stylesheets.

 

Note that I only downloaded your screen and reset stylesheets although the others did have absolute urls so they were probably being used and IE needs ActiveX enabled, but the csshover.htc file definitely made the drop down level under Services work. The menu is a bit jumpy in IE6, so you may have some more work to do.

 

I also notice that you are using the doctype <!DOCTYPE html> which I think is the new HTML5 method, but IE6 dropdown worked with that one or

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

  • Author

you're a life saver - i would have never found that file in a million years... it's invaluable!

 

thanks so much for taking the time to look at this for me.

 

thanks for confirming the jumpy menu in ie - i wondered if it was just happening to me as i was running a virtualised copy of ie on very little ram but i guess i do have some more work to do on that.

 

again, thanks a lot! :-D

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.