China Musings

Writings and Ramblings (A/V) from Guangzhou, China

The Importance of DOCTYPE

Filed under: Web Development — Adeh at 1:48 am on Wednesday, July 6, 2005

I learned something today while trying to figure out why the new design for backstreet was behaving so badly in IE6. Finally, I narrowed it down to one thing, the < !DOCTYPE> document identifier was not the first line of the file. Instead, I had flippantly placed an HTML comment in the first line, not realizing that it could cause problems. Sure enough, as soon as I removed that comment, everything in IE was a smooth as apple pie?

So if you are going to be a good web developer, and use modern web standard xhtml in your pages, remember that the doctype declaration must be at the top!

< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> <img src="">