{"id":133,"date":"2009-12-28T00:09:04","date_gmt":"2009-12-28T05:09:04","guid":{"rendered":"http:\/\/sethalling.com\/?p=133"},"modified":"2016-09-10T11:53:00","modified_gmt":"2016-09-10T16:53:00","slug":"fixing-ie-absolute-positioning-z-indexes","status":"publish","type":"post","link":"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/","title":{"rendered":"Fixing Internet Explorer, Absolute Positioning and Z-Indexes"},"content":{"rendered":"

A few weeks ago I was working on a company’s site before we launched their new design. I was asked to prep the drop-down menu in so it would work in Internet Explorer. It worked fine in IE8, but there were severe issues with IE6 and IE7. I don’t normally support IE6, unless I the client is paying a substantial amount, but I do support it to the point where at least all of the information is accessible even if it doesn’t look right.<\/p>\n

Anyway, in both IE6 and IE7, I found that the main banner image was covering the dropdown menu. I could not figure out what the problem was for quite sometime, and after doing some extensive searching on Google, I was able to learn what the problem was through a variety of sources.<\/p>\n

Because Internet Explorer 6 and 7 render absolutely positioned elements different than any other browser, they cause for elements to be overlapped in a different order. Then on top of that, if you use a z-index on the element, nothing is fixed. So, in an effort to make it easier for anyone else with this problem, I will try to explain how to hack this IE bug.<\/p>\n

The first thing you need to pay attention to is what positioning you are using. My problem was caused because I was using absolute positioning throughout the header. Now this shouldn’t be a problem, but I had multiple relative positioned elements within that same header.<\/p>\n

After a couple hours of testing various methods, I finally found something that works, and I believe I may understand it as well.<\/p>\n

Instead of setting the z-index on the absolutely positioned element itself, it needs to be set on a specific parent element. The way to find the which parent element is to look in the structure and find both elements that are overlapping incorrectly.<\/p>\n

For our example, we will use html > #wrapper > #header > .navigation > .drop-down<\/code> and html > #wrapper > #content > .banner<\/code>. What you need to do is continue backing up each parent element until you find where the parents are siblings. Using our example, it would be html > #wrapper > #header<\/code> and html > #wrapper > #content<\/code><\/p>\n

Next, you just need to give each of those parent elements a relative positioning and then set the z-indexes accordingly.<\/p>\n

It’s a whole lot more simple than reorganizing your entire structure, and it accomplishes the task of using z-indexes on relatively positioned elements, and their absolutely positioned children, with no side effects.<\/p>\n","protected":false},"excerpt":{"rendered":"

Internet Explorer was probably created because Microsoft hates developers, and here is yet another problem to prove it. IE6 and IE7 (thankfully not IE8) have problems when it comes to rendering overlapping absolutely positioned elements. Learn how to fix the bug that causes overlapping with absolutely positioned elements and z-indexes.<\/p>\n","protected":false},"author":1,"featured_media":206,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[6],"tags":[9,5],"acf":[],"yoast_head":"Fixing Internet Explorer, Absolute Positioning and Z-Indexes<\/title>\n<meta name=\"description\" content=\"Internet Explorer has problems when it comes to rendering absolute positioned elements, so Im explaining how to fix overlapping when z-indexes won't work.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fixing Internet Explorer, Absolute Positioning and Z-Indexes\" \/>\n<meta property=\"og:description\" content=\"Internet Explorer has problems when it comes to rendering absolute positioned elements, so Im explaining how to fix overlapping when z-indexes won't work.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/\" \/>\n<meta property=\"og:site_name\" content=\"Seth Alling\" \/>\n<meta property=\"article:published_time\" content=\"2009-12-28T05:09:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-09-10T16:53:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/sethalling.com\/content\/uploads\/2010\/12\/ie-absolute-header.png\" \/>\n\t<meta property=\"og:image:width\" content=\"610\" \/>\n\t<meta property=\"og:image:height\" content=\"144\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Seth Alling\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Seth Alling\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/\",\"url\":\"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/\",\"name\":\"Fixing Internet Explorer, Absolute Positioning and Z-Indexes\",\"isPartOf\":{\"@id\":\"https:\/\/sethalling.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/sethalling.com\/content\/uploads\/2010\/12\/ie-absolute-header.png\",\"datePublished\":\"2009-12-28T05:09:04+00:00\",\"dateModified\":\"2016-09-10T16:53:00+00:00\",\"author\":{\"@id\":\"https:\/\/sethalling.com\/#\/schema\/person\/31e4e1211a7d7d70251b7db49db74e37\"},\"description\":\"Internet Explorer has problems when it comes to rendering absolute positioned elements, so Im explaining how to fix overlapping when z-indexes won't work.\",\"breadcrumb\":{\"@id\":\"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/#primaryimage\",\"url\":\"https:\/\/sethalling.com\/content\/uploads\/2010\/12\/ie-absolute-header.png\",\"contentUrl\":\"https:\/\/sethalling.com\/content\/uploads\/2010\/12\/ie-absolute-header.png\",\"width\":610,\"height\":144,\"caption\":\"Fixing IE Absolute Positioning and Z-Indexes\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/sethalling.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fixing Internet Explorer, Absolute Positioning and Z-Indexes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/sethalling.com\/#website\",\"url\":\"https:\/\/sethalling.com\/\",\"name\":\"Seth Alling\",\"description\":\"Detroit WordPress Developer\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/sethalling.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/sethalling.com\/#\/schema\/person\/31e4e1211a7d7d70251b7db49db74e37\",\"name\":\"Seth Alling\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sethalling.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4ad3f61b13af506ff4fd890f1fe4cd64?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4ad3f61b13af506ff4fd890f1fe4cd64?s=96&d=mm&r=g\",\"caption\":\"Seth Alling\"},\"description\":\"Detroit Web Developer & Graphic Designer Follow me: Twitter | WordPress | GitHub\",\"url\":\"https:\/\/sethalling.com\/author\/sethalling\/\"}]}<\/script>","yoast_head_json":{"title":"Fixing Internet Explorer, Absolute Positioning and Z-Indexes","description":"Internet Explorer has problems when it comes to rendering absolute positioned elements, so Im explaining how to fix overlapping when z-indexes won't work.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/","og_locale":"en_US","og_type":"article","og_title":"Fixing Internet Explorer, Absolute Positioning and Z-Indexes","og_description":"Internet Explorer has problems when it comes to rendering absolute positioned elements, so Im explaining how to fix overlapping when z-indexes won't work.","og_url":"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/","og_site_name":"Seth Alling","article_published_time":"2009-12-28T05:09:04+00:00","article_modified_time":"2016-09-10T16:53:00+00:00","og_image":[{"width":610,"height":144,"url":"https:\/\/sethalling.com\/content\/uploads\/2010\/12\/ie-absolute-header.png","type":"image\/png"}],"author":"Seth Alling","twitter_misc":{"Written by":"Seth Alling","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/","url":"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/","name":"Fixing Internet Explorer, Absolute Positioning and Z-Indexes","isPartOf":{"@id":"https:\/\/sethalling.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/#primaryimage"},"image":{"@id":"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/#primaryimage"},"thumbnailUrl":"https:\/\/sethalling.com\/content\/uploads\/2010\/12\/ie-absolute-header.png","datePublished":"2009-12-28T05:09:04+00:00","dateModified":"2016-09-10T16:53:00+00:00","author":{"@id":"https:\/\/sethalling.com\/#\/schema\/person\/31e4e1211a7d7d70251b7db49db74e37"},"description":"Internet Explorer has problems when it comes to rendering absolute positioned elements, so Im explaining how to fix overlapping when z-indexes won't work.","breadcrumb":{"@id":"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/#primaryimage","url":"https:\/\/sethalling.com\/content\/uploads\/2010\/12\/ie-absolute-header.png","contentUrl":"https:\/\/sethalling.com\/content\/uploads\/2010\/12\/ie-absolute-header.png","width":610,"height":144,"caption":"Fixing IE Absolute Positioning and Z-Indexes"},{"@type":"BreadcrumbList","@id":"https:\/\/sethalling.com\/fixing-ie-absolute-positioning-z-indexes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sethalling.com\/"},{"@type":"ListItem","position":2,"name":"Fixing Internet Explorer, Absolute Positioning and Z-Indexes"}]},{"@type":"WebSite","@id":"https:\/\/sethalling.com\/#website","url":"https:\/\/sethalling.com\/","name":"Seth Alling","description":"Detroit WordPress Developer","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sethalling.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sethalling.com\/#\/schema\/person\/31e4e1211a7d7d70251b7db49db74e37","name":"Seth Alling","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sethalling.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4ad3f61b13af506ff4fd890f1fe4cd64?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4ad3f61b13af506ff4fd890f1fe4cd64?s=96&d=mm&r=g","caption":"Seth Alling"},"description":"Detroit Web Developer & Graphic Designer Follow me: Twitter | WordPress | GitHub","url":"https:\/\/sethalling.com\/author\/sethalling\/"}]}},"mv":{"thumbnail_id":206,"thumbnail_uri":"https:\/\/sethalling.com\/content\/uploads\/2010\/12\/ie-absolute-header-300x71.png"},"_links":{"self":[{"href":"https:\/\/sethalling.com\/wp-json\/wp\/v2\/posts\/133"}],"collection":[{"href":"https:\/\/sethalling.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sethalling.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sethalling.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sethalling.com\/wp-json\/wp\/v2\/comments?post=133"}],"version-history":[{"count":0,"href":"https:\/\/sethalling.com\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sethalling.com\/wp-json\/wp\/v2\/media\/206"}],"wp:attachment":[{"href":"https:\/\/sethalling.com\/wp-json\/wp\/v2\/media?parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sethalling.com\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sethalling.com\/wp-json\/wp\/v2\/tags?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}