I’ve been playing around with HTML and various other web technology for about seven years now. When I started I didn’t even know what a Document Type Declaration (DTD) was. Soon I found that specifically declaring one at the beginning of the HTML / PHP file solved so many problems. I’ve gone through various phases, beginning with xHTML and most recently ending with HTML 4 Strict. Now it’s on to HTML5, and I’m ecstatic with how simple the DTD statement has become.
Before, when I started a new page I would always copy the statement from a page I previously created. Really, who’s going to remember this:
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN”
And if you want to see what some of the other DTD statements look like, there’s a fairly exhaustive list over at Wikipedia.
HTML5 has a much simpler format, and here it is:
It’s simple; it’s clean; and, most importantly, I’ll remember it any time I need to start a new project.