<?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>Safetygoat &#187; ie6 renders differently</title>
	<atom:link href="http://www.safetygoat.co.uk/tag/ie6-renders-differently/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.safetygoat.co.uk</link>
	<description>The goat loves the water</description>
	<lastBuildDate>Fri, 10 Sep 2010 09:48:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IE6 Randomly moves stuff around and how to fix it</title>
		<link>http://www.safetygoat.co.uk/2008/08/ie6-randomly-moves-stuff-around-and-how-to-fix-it/</link>
		<comments>http://www.safetygoat.co.uk/2008/08/ie6-randomly-moves-stuff-around-and-how-to-fix-it/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 16:05:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[haslayout]]></category>
		<category><![CDATA[ie6 bug]]></category>
		<category><![CDATA[ie6 random move]]></category>
		<category><![CDATA[ie6 renders differently]]></category>

		<guid isPermaLink="false">http://www.safetygoat.co.uk/?p=89</guid>
		<description><![CDATA[
Recently I had to work on a layout that had a lot of javascript in it, and because the structure of the html couldn&#8217;t change, I positioned things absolutely and relatively ( position: absolute; position: relative;) in order to get things in the right place.  I was very pleased with the results and Firefox [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.safetygoat.co.uk/wp-content/uploads/2008/08/pig.jpg" rel="shadowbox[post-89];player=img;"><img class="alignnone size-full wp-image-90" title="pig" src="http://www.safetygoat.co.uk/wp-content/uploads/2008/08/pig.jpg" alt="" width="500" height="141" /></a></p>
<p>Recently I had to work on a layout that had a lot of javascript in it, and because the structure of the html couldn&#8217;t change, I positioned things absolutely and relatively ( position: absolute; position: relative;) in order to get things in the right place.  I was very pleased with the results and Firefox and IE7 looked exactly the same.  Then came IE6.  It was slightly off when I first loaded it in, so I did the typical thing and just did some conditional code for ie 6.  Then, the next time I refreshed, things moved into random other places.  And then again on the next refresh.  And then not on the next refresh.  And so on.  How did I fix it?  On today, the 7th birthday of IE6, when others are working hard to <a href="http://iedeathmarch.org/2008/08/we-like-our-internet-with-a-side-of-revolution/" onclick="pageTracker._trackPageview('/outgoing/iedeathmarch.org/2008/08/we-like-our-internet-with-a-side-of-revolution/?referer=');">put ie6 on its death march</a>, here&#8217;s a bit of code that made my life a little brighter&#8230; <span id="more-89"></span></p>
<p><a href="http://www.safetygoat.co.uk/wp-content/uploads/2008/08/supposedto.jpg" rel="shadowbox[post-89];player=img;"><img class="alignnone size-full wp-image-93" title="supposedto" src="http://www.safetygoat.co.uk/wp-content/uploads/2008/08/supposedto.jpg" alt="" width="500" height="471" /></a></p>
<p>Here&#8217;s my pig, sitting pretty in its box.  Isn&#8217;t he sweet?  Now look what happens when in IE6.</p>
<p><a href="http://www.safetygoat.co.uk/wp-content/uploads/2008/08/refresh1.jpg" rel="shadowbox[post-89];player=img;"><img class="alignnone size-full wp-image-91" title="refresh1" src="http://www.safetygoat.co.uk/wp-content/uploads/2008/08/refresh1.jpg" alt="" width="500" height="332" /></a><a href="http://www.safetygoat.co.uk/wp-content/uploads/2008/08/refresh2.jpg" rel="shadowbox[post-89];player=img;"><img class="alignnone size-full wp-image-92" title="refresh2" src="http://www.safetygoat.co.uk/wp-content/uploads/2008/08/refresh2.jpg" alt="" width="500" height="311" /></a></p>
<p>Gorgeous, isn&#8217;t it?  Okay, now that you&#8217;ve felt my pain,  here&#8217;s the solution&#8230;.</p>
<p>The reason it didn&#8217;t work was because the box that surrounded the whole area, which I defined as &#8220;position: relative&#8221; didn&#8217;t have a &#8220;haslayout&#8221; property.  Things that have layouts are things like boxes and whatnot, and for some reason ie6 has some random problems with this and randomly renders things differently.  To fix it, you have to force it to have a layout.  There are a number of ways to give something a layout, but this is the one I used:</p>
<p>*html .className{</p>
<p>height: 0;</p>
<p>he<strong>\</strong>ight: auto;</p>
<p>zoom: 1;</p>
<p>}</p>
<p>Apparently this is what you need to do to get it to have some layout.  (Yes, that backslash is there on purpose&#8211;it&#8217;s not a typo.  Not sure why, but it fixed my problem, so let&#8217;s not fuss&#8230;make sure you put it in!).  My work doesn&#8217;t have a separate style sheet for ie (don&#8217;t even get me started on that decision!) so in my main css file, I add *html and a space in front of the class name.  This makes the class invisible to everything but ie6.</p>
<p>Hopefully hacks like this will die with IE6, but until then, give yourself some layout, and save yourself a lot of hassle!</p>
<p>N.B.  there is no need to apply this to every element in your layout.  In my case, it only needed to be applied to my outer container that I made that only had the position:relative class on it and no other height elements.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.safetygoat.co.uk/2008/08/ie6-randomly-moves-stuff-around-and-how-to-fix-it/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->