HTML 4.0

The most recent release of recommendations for HTML is Version 4.0 (http://www.w3.org/MarkUp/). As you will see in more detail in Section 7.1, HTML 4.0 has a considerably larger vocabulary than the previous release that is in common use, Version 3.2. Surprisingly, this time around the standard is way ahead of the browser makers. Many of the new features of HTML 4.0 are designed for browsers that make the graphical user interface of a web page more accessible to users who cannot see a monitor or use a keyboard. The new tags and attributes readily acknowledge that a key component of the name World Wide Web is World. Users of all different written and spoken languages need equal access to the content of the Web. Thus, HTML 4.0 includes support for the alphabets of most languages and provides the ability to specify that a page be rendered from right to left, rather than left to right, to accommodate languages that are written that way.

Perhaps the most important long-term effect of HTML 4.0, however, is distancing the content of web pages from their formatting. Strictly speaking, the purpose of HTML is to provide structural meaning to the content of pages. That’s what each tag does: this blurb of text is a paragraph, another segment is labeled internally as an acronym, and a block over there is reserved for data loaded in from an external multimedia file. HTML 4.0 is attempting to wean authors from the familiar tags that make text bold and red, for example. That kind of information is formatting information, and it belongs to a separate standardization effort related to content style.

In the HTML 4.0 world, a chunk of text in a paragraph is bold because it is tagged as being an element that requires emphasis. Whether it is bold or italic or green is not defined by the HTML vocabulary, per se. Instead, the HTML passes the formatting decision to a style definition. When the text is viewed in a browser on a video monitor, the color may be green and the style italic, but when the same page is viewed through a projection system, it may be a different shade of green, to compensate for the different ambient lighting conditions, and bold, so it is more readable at a distance. And when the content is being read aloud electronically for a blind user, the voice speaks the tagged words with more emphasis. The key point here is that the content—the words in this case—was written and tagged once. Style definitions, either in the same document or maintained in separate files that are linked into the document, can be modified and enhanced independently of the content.

As a modern HTML author, you should find it encouraging that the HTML 4.0 working group did not operate in isolation from what is going on in the real world. Their recognition of the work going on with style sheets is just one example. Another is their clear understanding of the role of client-side scripting: the <SCRIPT> and <NOSCRIPT> tags are part of the HTML 4.0 specification, and most elements that get rendered on the page have scripting event handler attributes defined for them right in the HTML 4.0 specification. This represents a very realistic view of the web authoring world.

Netscape Navigator 4 was released many months before the HTML 4.0 specification was published, which means that the HTML support in that browser was decided on well before the scope of HTML 4.0 was finalized. As a result, Navigator’s support for the new features of HTML 4.0 is limited to the internationalization features and the separation of style from content by way of style sheets. Many of the new tags and the new attributes for existing tags are not supported in Navigator 4. Internet Explorer 4 reached its final release much closer to the publication of the HTML 4.0 specification; as a result, the Microsoft browser includes substantially more support for new features of HTML 4.0, especially in the way of structural elements for table components. Section 7.1 describes which new tags are supported by each browser, and Chapter 8, provides a complete HTML reference.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.