CornerPixel Blog RSS 2.0

# Friday, July 03, 2009

Most of you reading this article are probably saying, “Ya we know DOCTYPE is the first thing you add.”   I mean man it is on the top of the page.

Well anyway just a couple days ago, I had a friend of whom I generally trust his markup skills come to me with a center align issue in IE7.

I took about 5 minutes and combed through the site via Firebug and the Developer Toolbar (kind of like Firebug for IE)  I couldn’t  see any good reason that his main container div should not be centered.

The CSS and markup was right and the parent container element looked like it wasn’t causing any interference.  I have to admit for a minute I was stumped.

Well my last step was to pull out the source markup and check for unclosed div elements.  (I was getting desperate).  In doing this I saw he had no DOCTYPE!  This was making IE7 run in quirks mode.  When my friend added the DOCTYPE his page magically worked the way it was supposed to.

So that you guys and gals don’t make the same mistake, I included below what I should have done in this situation.  (I use the excuse that my friend normally wouldn’t make this mistake, and that’s why I didn’t follow the below steps.)

Okay I should have looked at the markup first and made sure there was a DOCTYPE.  Secondly I should have run the site through validation.

There ya have it.  A small post on the importance of a DOCTYPE.  I hope it has helped.  I also have a couple links below to good DOCTYPE information.

Friday, July 03, 2009 4:46:30 AM (Pacific Standard Time, UTC-08:00)

#       Comments [0] - Trackback

Browser - IE General | Web Standards

Comments are closed.

Archive

<July 2009>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

Email Subscription

Sign up to get the CornerPixel Blog delivered to your email.

About the Author

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Sign In

Statistics

Total Posts: 51
This Year: 2
This Month: 0
This Week: 0
Comments: 26