Authoring Webpages/HTML, XHTML and DOCTYPEs

From Wikibooks, open books for an open world
Jump to navigation Jump to search

The current version of HTML is HTML5. Since modern browsers have been supporting HTML5 for several years now (as of 2016), you'll probably want to use that one.

Versions of HTML prior to 4.0 are obsolete. Web pages in these versions should be withdrawn or converted to a variant of HTML version 4.01 or HTML5. No new page should be created using a version prior to HTML 4.01. You shouldn't be using any variant of XHTML, since it has largely been abandoned in favor of HTML5.

Internet Explorer version 8.0 and earlier (about 6% of web surfers were using Internet Explorer version 8.0 or lower in December 2014) does not support HTML5.

Validation[edit | edit source]

Regardless of the version of HTML you choose to use, it is important that you regularly validate your pages to ensure they conform to your chosen specification. The World Wide Web Consortium (W3C) has an online validator at You can either upload or HTML file or copy and paste it into the validator.

HTML5 Doctype[edit | edit source]

The Doctype for HTML5 is <!DOCTYPE html>

All HTML5 documents must start with this line. Note that while this looks like a tag, it has special rules. It does not have a closing tag, nor is it self-closing.

Previous: Adapting a webpage for visual browsers - Up: Table of Contents - Next: Collecting pages in a website