IE7 and DocType Alert!

Yes thats right IE7 is a ‘dick’, yes I said ‘dick’, when it comes to anything when web developing in HTML and JavaScript. One new fascinating tip I will have to keep in mind is doc types. Recently I’ve been building a TV Show Script, going at $15 bucks if any one is interested contact me, and FireFox was going great. PHP was going smooth then I’m thinking everything goes smooth few times around in most browsers including IE, so I came into a margin aligning problem. Me and a friend ‘Ethrel’ we’re trying to figure out this problem, we did two different ways when it came to aligning, heres a few:

#wrapper
{
position: absolute;
margin-left: auto;
margin-right: auto;
width: 800px;
}

#wrapper
{
position: absolute;
left: 50%;
margin-left: -400px;
}

So I’m going crazy wondering why it didn’t work, We both stumbling to find an answer, and he came up with somethings wrong with the margins not working. I being stupid and forgetting it isn’t valid XHTML because I didn’t add a doctype to the top of my HTML to define how the page should be displayed. With that say I’m guessing FireFox has a default doctype set for all html pages if one isn’t set, but IE wont parse as much correctly without one. I guess theres a limit of some sort.

If your like me and don’t remember doctypes off the bat you can bookmark one of my favorite sites I visit occasionally when I need help: http://xhtmldoctype.com/

Hope that helps for any IE7 Users, this possibly might be a problem with all browsers.

Leave a comment