Register now or login here to start promoting your blog and your favourite articles.
10 Awful IE Bugs and Fixes
14 Sep 2009 - 26 Comments
I have listed 10 common Internet Explorer bugs and solutions. I believe this will able to help you shorten the times spent on debugging the layout inconsistensies in IE.
Author: kevin | Source: queness

Introduction

Everyone has a story to tell when dealing with Internet Explorer. As a developer I have faced numerous bizzare problems with IE and sometimes you just want to bang your head against the wall! However, as time goes by, we slowly learn from mistakes (well, sometimes it's not our fault, it's IE!!!) and start to adapt and understand IE's weird behaviors. We have to because there is still a considerable number of IE6 users. The best practise is to continuously test your website from the start across different browsers. It's easier to fix the layout problems from the start rather than testing and fixing it in the end after thousands of lines of html and css code.

There are a lot of campaigns out there to protest against IE6. People who support it are mostly web specialists and normal users just don't seem to care. So, what we can do now? We have to continue to digging around to fix IE6 issues. But, wait for it, there is a Good and Exciting News. Based on the monthly stat from w3cschool, IE6 users have been steadily decline over a few years. Since 2006 Jan 60.3% until now 2009 Aug 13.6%. At this rate, we should able to get rid of IE6 around end of next year 2010. YES!!!

Right, Back to reality, I have listed all the problems that I have encountered before into a list for future reference. I believe this will help you shorten the times spent on debugging the layout inconsistensies in Internet explore.

1. IE6 Ghost Text Bug

Just before I wrote this article, I encountered this bug. It's so bizzare and hilarious. A piece of duplicated text came from nowhere and IE6 display it somewhere in the bottom near to the original text. I couldn't solve it, so I search for it, and BINGO, it's just another IE6 Bug.

There are quite a lot of solutions for it, but none of them work to me (I can't use some of the methods because of the complexity of the website.), so I used a really hacky method. Adding spaces next to the original text seems to solve the problem.

However, from a website called Hippy Tech Blog I found online. The reason behind it is due to the html comment tag. IE6 can't render it properly. The following is a list of solutions he suggested:

Solution
  • using <!—[IF !IE]> tags around the comment.
  • remove the comment
  • in the preceding float add a style {display:inline;}
  • Use –ve margins on appropriate floating divs.
  • adding extra &nbsp; (like 10 spaces) to the orginal text (the hacky way)

2. Position Relative and Overflow Hidden

I faced this problem a lot of times when preparing a jQuery tutorial, because I used overflow hidden a lot to make the desired layout.

It happens when the parent element overflow set to hidden and the child element is set to position:relative.

CSS-Trick has a good example to demonstrate this bug. position:relative and overflow in internet explorer

Solution
  • Add position relative to the parent element.

3. Min-Height for IE

It's simple, IE ignores min-height properties and you can use the following hack to fix it. Credit to Dustin Diaz

This solution works like a charm in IE6, Mozilla/Firefox/Gecko, Opera 7.x+, Safari1.2

Solution
selector {
  min-height:500px;
  height:auto !important;
  height:500px;
}

4. Bicubic Image Scaling

You'll love this one. Does the bad image scaling in IE bothering you? If you compared other browsers and IE, IE's rescaled image doesn't look as good as other.

IE versus firefox

Solution
img { -ms-interpolation-mode: bicubic; }

5. PNG Transparency

I guess everyone knows this, but I'm going to put it here anyway just for future reference :)

So if you want to use transparent image and GIF doesn't give you the quality you want, you will need this hack for PNG. You have to be aware, if you use a PNG as background, you will not able to set the background position.

Solution
img {
	filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(...);
}

6. IFrame Transparent Background

In firefox and safari you shouldn't encounter this problem because by default, the iframe background is set to transparent, but in IE, it doesn't. You need to use allowTransparency attribute and put the following CSS code to achieve that.

Solution
/* in the iframe element */
<iframe src="content.html" allowTransparency="true">
</iframe>


/* in the iframe docuement, in this case content.html */
body {
	background-color:transparent;	
}

7. Disabled IE default Vertical Scroll bar

By default, IE displays vertical scrollbar even though the content fit nicely in the window. You can use overflow:auto to show it only when you need it.

Solution
html {
	overflow: auto;
}

8. :hover Pseudo Class

IE only supports :hover pseudo class for anchor element. You can achieve the same effect using jQuery hover event.

Solution
/* jQuery Script */
$('#list li').hover(

	function () {
		$(this).addClass('color');
	},
	
	function() {
		$(this).removeClass('color');
	}
);


/* CSS Style */
.color {
	background-color:#f00;	
}

/* HTML */
<ul id="list">
	<li>Item 1</li>
	<li>Item 2</li>
	<li>Item 3</li>
</ul>

9. Box Hack Model

This is the hottest bug in IE. The basic understanding is that IE calculates width differently. Based on w3c standard, total width of an element should be

  • total width = margin-left + border-left + padding-left + width + padding-right + border-right + margin-right

However, Internet Explorer calculates it without adding paddings and borders:

  • total width = margin-left + width + margin-right
For more details, please check out this link: Internet Explorer and the CSS box model Detailed Explanation Solution
  • Use the w3c use standards compliant mode. IE6 or later will calculate the width based on w3c standard, however, you will still having problem for IE5

Or, you can use CSS Hack to solve this problem. All standard compliant browsers will able to read w\\dth:180px except IE5.

#content {
	padding:10px;
	border:1px solid;
	width:200px;
	w\\idth:180px;
}

10. Double Margin Bug Fix

If you have floated elements with margin left and/or right assigned, IE6 will double up the margin. Forexample, margin-left:5px will become 10px. You can solve that by adding display:inline to the floated element.

Solution
div#content {
	float:left;
	width:200px;
	margin-left:10px;

	/* fix the double margin error */
	display:inline;
}

Final words

I hope this article will help you all. Please bookmark it, share it and spread it to the rest of the web designers and developers! :)

Copyright & Usage

The effects and techniques demonstrated in tutorials on Queness can be used in whatever manner you wish without attribution. You cannot copy whole tutorials (unless permission is given), either in English or translated to another language.

Share This Post to Support Me! :)


Comments

SEO directory on 5 Mar 2010 says:
Great article! Very helpful.
search engine optimization on 2 Mar 2010 says:
Just wanted to say thanks for sharing such useful information. I'll pass it on to the readers of my blog :) <a href="http://www.mediaonepro.com">Web SEO Expert</a>.
Webdesigner on 26 Feb 2010 says:
Thanks, good article. It works!
Web seo specialist on 3 Feb 2010 says:
Thanks for the sharing of such information. we will pass it on to our readers. This is a great reading. Thanking you. <a href="http://www.seochampion.com">Web seo specialist</a>
kaddechi on 27 Jan 2010 says:
good website
freaknboy on 26 Jan 2010 says:
Great great great, my favorite IE bug fix tips,
go on ! thks
Vipul Mathur on 21 Jan 2010 says:
Very helpful article.
ecommerce website on 20 Jan 2010 says:
Thanks for the information..
Please enter here more common IE bugs...
denbagus on 28 Dec 2009 says:
nice information about find bug & fixes
Kartlos Tchavelachvili on 22 Dec 2009 says:
Thanks for this killer tips! especially #7 and #6


Leave a comment

Subscribe RSS Subscribe RSS, Keep yourself updated with queness latest posts!
Pixel Crayons Increase your traffic!

Buy wholesale computers directly from China at DHgate.com

Discover the tools to build your e-Commerce Site with Netfirms

  •  
  •  
  •  
  •  
  •  

Community News

Recent Comments

Random Posts



Digging in Wordpress
View all posts and news Back to top

About the Author

A web designer and developer who is passionate and keen on contributing to the web development industry. Feel free to say hi to me, or follow me on twitter.

Kevin Liew

Partner

  • Web and Designers
  • CSS Style
  • PV.M Garage Blogzine - (Italian)
  • TutsValley
  • Designrfix
  • CoolVibe
  • Web Developer Juice
  • Denbagus
  • Web Hosting Secret Revealed
  • PSD to HTML Conversion
  • BlueHost