<?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>DebonStudio &#187; css bugs</title>
	<atom:link href="http://www.debonstudio.com/blog/tag/css-bugs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.debonstudio.com/blog</link>
	<description>Olivier Debon</description>
	<lastBuildDate>Tue, 29 Jun 2010 21:04:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Dealing with IE6 CSS Bugs</title>
		<link>http://www.debonstudio.com/blog/dealing-with-ie6-css-bugs/</link>
		<comments>http://www.debonstudio.com/blog/dealing-with-ie6-css-bugs/#comments</comments>
		<pubDate>Wed, 27 May 2009 18:46:35 +0000</pubDate>
		<dc:creator>Olivier</dc:creator>
				<category><![CDATA[web design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css bugs]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://www.debonstudio.com/blog/?p=161</guid>
		<description><![CDATA[Although Internet Explorer 7 and the newly release Internet Explorer 8 have made progress in replacing the infamous Internet Explorer 6, there are still about 30% of users who still use it globally, and depending on your audience, that number could even be larger. 84% of DebonStudio.com visitors are using Internet Explorer, with roughly half [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-182" title="Frustration over IE6 bugs" src="http://www.debonstudio.com/blog/wp-content/uploads/2009/05/ie6_bugs.jpg" alt="Frustration over IE6 bugs" width="200" height="171" />Although Internet Explorer 7 and the newly release Internet Explorer 8 have made progress in replacing the infamous Internet Explorer 6, there are still about 30% of users who still use it globally, and depending on your audience, that number could even be larger.</p>
<p>84% of <a href="/">DebonStudio.com</a> visitors are using Internet Explorer, with roughly half of them being IE6. So 42% of the total visits are done using Internet Explorer 6. Compare this with the <a href="http://www.w3schools.com/browsers/browsers_stats.asp">W3C School</a> website, where almost 50% of visitors are using Firefox (IE6 users amount to only 15%).</p>
<p><strong>A word about IE5.5 and earlier versions</strong></p>
<p>I don&#8217;t worry too much anymore about IE5.5 and earlier versions. They are now representing such a tiny share of the browsers market that they can be safely ignored. But if you really, really, really want to accommodate these browsers, this page goes through the <a href="http://www.richinstyle.com/bugs/ie5.html" target="_blank">IE5.5 and earlier browsers bugs</a>.</p>
<p><span id="more-161"></span>Ok, enough already, let&#8217;s get to it!</p>
<p><strong>The Internet Explorer Conditional Comment</strong></p>
<p>Until IE6 meets the same fate as its predecessors and fades away like a bad dream, you should go the extra mile and make sure your web pages are properly rendered in IE6.</p>
<p>Some of the IE6 css bug fixes listed in this article are straight forward, but for others some &#8220;hacks&#8221; are necessary to make IE6 behave. Depending on the amount of extra code needed, it is sometime easier to just create a separate style sheet and call it only when the page is viewed in IE6 using an Internet Explorer <a href="http://reference.sitepoint.com/css/conditionalcomments" target="_blank">conditional comment</a>.</p>
<p>As an example, the conditional comment below will load the <em>ie-css-fixes.css</em> style sheet only if the page is viewed in IE6 or an older version. (The &#8220;lte&#8221; meaning &#8220;less than or equal to&#8221;)</p>
<p><code>&lt;!--[if lte IE 6]&gt;<br />
&lt;style type="text/css" media="screen"&gt;@import "ie-css-fixes.css";&lt;/style&gt;<br />
&lt;![endif]--&gt;</code></p>
<p>Doing so will ensure that non Internet Explorer browsers don&#8217;t unnecessary load the extra style sheet since they will ignore this code as a comment.</p>
<p><strong>The Box Model Bug</strong></p>
<p>This bug is responsible for a lot of gray hair in the web development community. It occurs when IE6 is in Quirks Mode, which happens when the html document doesn&#8217;t have a Doctype declaration or has an incomplete or erroneous one. The bug was corrected with the release of Internet Explorer 6. But if in Quirks Mode, Internet Explorer 6 falls back to the way earlier versions rendered html documents, thus applying the old box model. To prevent this from happening, simply don&#8217;t forget to put a valid Doctype declaration in all your web page. To verify that the page has a valid Doctype declaration, use the <a href="http://www.validator.w3.org/">W3C Markup Validation Service</a>.</p>
<p>Here&#8217;s an example of a Doctype declaration:</p>
<p><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<br />
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</code></p>
<p><em>What is the box model bug anyway?</em></p>
<p>When Microsoft implemented the box model for Internet    Explorer 5/win, they decided that a div (box) &#8220;width&#8221; declaration should refer to the outer dimension of the entire div. That means the width of a div would include the standard width, any padding applied to it and also its borders. The visual result would be a much smaller div depending on the amount of padding and the size of the borders. Only fluid div were unaffected. All the workarounds and hacks have been about applying a different width depending on which browser was used.</p>
<p>Read this <a href="http://css.maxdesign.com.au/listamatic/about-boxmodel.htm" target="_blank">article</a> for more details.</p>
<p><strong>IE6 Doubled Float-Margin Bug</strong></p>
<p>You probably encountered this weird bug if you have been using margins on your float elements. For example, you use a 10px left margin on a left float element inside a container, everything looks normal on all browsers except when you view your page in IE6, for some weird reason the 10px margin has become a 20px margin, resulting in a broken layout. Steve Clason discovered a quick and easy fix by simply adding a &#8220;display: inline;&#8221; on the float element. It makes IE6 behave properly and apply the margin without doubling its size. By the way this will fix also the <a href="http://www.positioniseverything.net/explorer/dup-characters.html" target="_blank">Duplicate Characters Bug</a>.</p>
<p><code>div.floated-element { display: inline; }</code></p>
<p>You can read this <a href="http://www.positioniseverything.net/explorer/doubled-margin.html" target="_blank">great  article</a> for a more detailed explanation.</p>
<p><strong>IE6 Peekaboo Bug</strong></p>
<p>This bug is triggered when you have a float next to some content inside a container. Upon loading the page in IE, the content is nowhere to be seen. If you scroll down the page or switch to another window and come back, this time it is there. No, it&#8217;s not magic, it&#8217;s IE6. To this day, I haven&#8217;t heard a coherent explanation for that behavior, but fortunately, there are a few fixes. An easy one is to give the container a zoom property of 1.</p>
<p><code>div.container {   zoom: 1;   } </code></p>
<p>But it won&#8217;t validate, so put it inside a IE Conditional Comment.</p>
<p><a href="http://www.positioniseverything.net/explorer/peekaboo.html" target="_blank">Read more</a> about this bug.</p>
<p><strong>Three-pixel text jog bug</strong></p>
<p>This bug manifests itself when you have text adjacent to a floated element. A mysterious 3-pixel gap appears between the text and the floated element until the floated element stop. Then it&#8217;s back to normal.</p>
<p>I tried several fixes that are available on the web, but couldn&#8217;t make it work. The only way the gap would disappear is if the adjacent element is floated also. But this has to be IE6 specific (use IE conditional comment) and the margin obviously needs to be eliminated or it will be applied between the 2 elements.</p>
<p><strong>The Underscore Hack</strong></p>
<p>A quick and dirty trick I use often to hunt for bugs is the underscore hack. IE6 and older versions ignore the underscore and apply the rule, while other browsers don&#8217;t recognize it.</p>
<p><code>#header {<br />
margin: 10px;<br />
_margin: 20px;<br />
}</code></p>
<p>In the example above, all browsers will apply a 10px margin to the header, but IE6 and below will apply a 20px margin.</p>
<p><strong>The !important Hack</strong></p>
<p>IE6 and earlier version don&#8217;t seem to care for the !important keyword. So you can use it to selectively apply rules to these browsers. Using the same example as above, it would look like this:</p>
<p><code>#header {<br />
margin: 10px !important;<br />
margin: 20px;<br />
}</code></p>
<p>The advantage of the !important hack other the previous underscore hack is that it will validate. Otherwise it does the same thing.</p>
<p><strong>IE6 days will end eventually</strong></p>
<p>Although the bugs mentioned in this post are the most common regarding IE6, there are plenty others that will keep you wondering what is wrong with the Microsoft folks and why they disregard the W3C standards so often. Unfortunately, Internet Explorer is the lion share on the browser market, like it or not. So you will have to accommodate and be patient, there is light at the end of the tunnel, each day that goes by, less and less people are using Internet Explorer 6.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debonstudio.com/blog/dealing-with-ie6-css-bugs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

