How HTML5 Works

HTML5 Foundation Technologies

A lot of people recognize HTML code when they see it, but understanding it is a different story.
A lot of people recognize HTML code when they see it, but understanding it is a different story.

A markup language uses a series of tags to mark elements in a file. The markup relies on some sort of model that defines what those elements are and how to use them. Since HTML has always been about encoding documents, it relies on something called a document object model (DOM). The DOM is incorporated within the Web browser application itself. Thus, the markup language is just a way of giving the browser instructions based on a model that it already understands.

To better understand the relationship between a DOM and HTML, think of the DOM as a box of rubber stamps. Each stamp is a different element within the DOM. Each page written in HTML is just a series of imprints made from the stamps, which are filled in with your own custom content. The Web browser can display anything created from the stamps in that box.

Technically speaking, the DOM is an application programming interface (API) providing a platform-neutral way to process either HTML or XML documents. (Extensible Markup Language, or XML, looks similar to HTML, but it lets the programmer add a customized set of elements you can use in a document.) The HTML5 standard requires the DOM known as DOM5 HTML. Prepared for the growth in HTML5, the latest versions of Chrome, Firefox, IE, Safari and Opera browsers can all process pages under the DOM5 HTML.

Another important foundation for HTML5 is its associated Multipurpose Internet Mail Extensions (MIME) types. MIME is an Internet Engineering Task Force (IETF) standard for alerting Internet-capable software what type of content it's trying to process. This typically corresponds to a specific type of file, such as an HTML document or MP3 audio file.

Web developers specify MIME types when they encode a Web page. This prompts the browser to load the corresponding files appropriately according to their types. There are two MIME types that join DOM5 HTML to form the basis of the new HTML5 standard: the HTML MIME type (text/html) and the XML MIME type (application/xhtml+xml). HTML5 includes updates in the syntax for both of these MIME types.

In short, the fundamental technologies in the HTML5 standard are DOM5 HTML and the HTML5-compatible MIME types for HTML and XML. Next, let's move on to how to put together a Web page using HTML5.