With HTML 5 coming into use even as I write this it seemed like a good time to look over the various document definitions I may be calling on when coding webpages.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
The standard beginning to to XHTML 1.0 Strict documents. This is the standard DOCTYPE used across the web. You can learn which tags are no longer allowed here: zvon.org. You can follow this link to learn the rules that XHTML follows: W3G XHTML guidlines.
Slightly older is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
The main benefit of HTML over XHTML is that it has optional opening and closing tags and can even have empty tags. XHTML insists on the markup being properly closed and formatted. Although XHTML tags do allow you to open and close them in the same tag, such as <br />
Now comes HTML 5.0 which adds many new elements and provides a way to play video and audio files without additional plugins. The beginning of the HTML 5.0 doc is as follows:
Thats it. HTML 5 is definitely designed to be much more streamlined than the two previous markup languages. They also changed
<div id="header"> to <header>
to name just one new tag. They are really simplifying the markup so that they can push layout to the style sheet and just have the data in the html document. HTML 5.0 takes webpages one more step toward XML. You can find more information about HTML 5 here: w3 developer docs HTML 5 you can also find which browsers are supporting it at: Browser Comparison on Wikipedia