Bizarre world of IE

October 23rd, 2005

The more I dig, whacky I found. Internet Explorer - one of the most popular browser in the world surprises me every time.

I was working on a new layout which is using a fixed width approach and centrally aligned on screen. I simply set the right and left margin to ‘auto’ to centrally align the container div. Its working fine in Firefox, its working fine in Opera but Dam! IE can’t get it centrally align. I searched on net and found a simple hack which says simply redefine the body tag and make the content center align. Though it fixed the problem in IE but don’t know why I didn’t use it.

So I tried many other ways, which led me to new discovery. This problem can be fixed in IE very easily if you define a DTD on your page WITH full URI of .dtd file on w3c.org.

On further searching on Google, I discovered when IE don’t find any DTD declaration on a HTML page, it switch into ‘Quirks Mode’ and will not follow CSS rules fully.

Entry Filed under: Internet Explorer, CSS

Leave a Comment

You must be logged in to post a comment.

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

August 2008
M T W T F S S
« May    
 123
45678910
11121314151617
18192021222324
25262728293031

Most Recent Posts

Categories

Posts by Month