IE once again proves the curse of my existence. At the top of the site I'm working on, there is a horizontal menu whose element launches a menu with pure CSS, which is positioned as absolute in the parent DIV menu (positioned relatively). This perfectly positions the menu in both IE and W3C compatible browsers.
The problem occurs when I have more positioned elements further on the page. They are also positioned relative to each other, because inside them there is data that must be set absolute ... again, this is displayed correctly in all browsers that I tested it on.
The problem is that then the top menu opens, part is hidden by positioned elements further down the page - in fact, it is positioned BELOW by these elements, even though there are z-index properties for everyone. (both in the CSS file and in the line).
The only way to get IE to display it correctly is to place the actual HTML for the menu at the bottom of the page, below (in DOM terms) the elements located elsewhere on the page. I would do it as an absolute last resort.
All elements are of the same type (div). Here is the relevant HTML:
<div id='menu'> <div id='cat_menu' style='display:none;z-index:10000;'> <table cellspacing='0' cellpadding='0' class='brmenu' width='100%'> [data] </table> </div>
<div class='product_new' style='z-index:20;'>[data]</div> <div class='product_listing' style='background-color:#FFFFFF;'>[data]</div>
And the corresponding CSS:
div#menu { height: 26px; padding: 0; position: relative; } div#cat_menu { position: absolute; top: 25px; left: 115px; width: 300px; z-index: 1000; } div.product_new { background-image: url("/images/sp_images.png"); background-position: 0 -108px; background-repeat: no-repeat; padding 0px; height: 40px; font-size: 9pt; margin-top: 5px; position: relative; z-index: 20; }
source share