EXtensible HyperText Markup Language

XHTML stands for EXtensible HyperText Markup Language. XHTML is aimed to replace HTML in the future. This is necessary, because since the World Wide Web has grown enormously certain issues have raised. In the past years many authors started to publish documents on the internet. Since HTML was quite easy to learn more and more people began to create their own website. During the early 1990's the graphical browsers gained popularity. Netscape and Mosaic were well-known during those days. Later on Microsoft bought Mosaic and refactured it to Internet Explorer.

The manufacturers of the browsers made sure that their browsers could handle all tags of the official HTML specification. But many manufacturers thought that the specification was not sufficient enough and wanted to give their users more possibilities. So they created their own tags and made sure that their browsers recognized these tags as well. Netscape for instance supported the <blink> tag to make the text placed between <blink> and </blink> blink. Microsoft Internet Explorer had the <marque> tag, which could be used to create a line with horizontal scrolling text. The text between <marque> and </marque> was used within the scrolling line.

It takes no genious to figure out that at a certain point it became one big mess, because no browser stuck to the specification. A specification is a good thing to have, but it has no value if it is not used in a proper way. Browser A supports a certain tag, but that same tag is not supported by another browser. It is no big disaster, because a browser is supposed to ignore a tag, which it doesn't know about. No well written browser may crash on a page with tags not supported by that browser. This is, because in the future tags may be added to the specification and in that way the old browser still will be usable. Ofcourse without displaying the additional features by that tag.

It becomes a disaster, when authors start using tags, which are supported by only one browser. If these tags cause a certain behaviour and the page was meant to be displayed with that behaviour, it will be an unpleasant surprise to discover that the page is rendered in a different way by another browser.

XHTML is almost identical to HTML 4.01, which is the HTML recommendation released on 24th December 1999. This recommendation fixes a number of bugs in the HTML 4.0 specification. In a way XHTML is a stricter and cleaner version of HTML. XHTML is HTML defined as an XML application, which means that XML rules apply to XHTML. Proper nesting and closing of tags is obliged.

At the time of the writing of this document XHTML 1.0 was the latest version of XHTML. XHTML 1.0 is the first recommendation for XHTML by W3C, the World Wide Web Consortium. In a way the XHTML specification is a follow-up to earlier work on HTML 4.01, HTML 4.0, HTML 3.2 and HTML 2.0. With a many features, XHTML 1.0 is a reformulation of HTML 4.01 in XML, and combines the strength of HTML 4 with the power of XML.

XHTML 1.0 is the first major change to HTML since HTML 4.0 was released in 1997. It makes it possible to apply XML standards to Web pages and is the keystone in W3C's work to create standards that provide richer Web pages on an ever increasing range of browser platforms including cell phones, televisions, cars, wallet sized wireless communicators, kiosks, and desktops.

XHTML 1.0 redefines HTML as an XML application. This makes it easier to process and easier to maintain pages using XHTML. XHTML 1.0 uses the tags from W3C's earlier work on HTML 4, and can be interpreted by existing browsers, by following a few simple guidelines. This makes it easy to modify existing pages to XHTML.

There is an Open Source tool available which can help a lot in performing this job. The name of this utility is HTML Tidy. It is possible to roll over old HTML documents into XHTML using this Open Source HTML Tidy utility. It also cleans up markup errors, removes clutter and prettifies the markup making it easier to maintain.

XHTML 1.0 is specified in three "flavors". When creating an XHTML document you specify which of these variants you are using by inserting a line at the beginning of the document. The browser that renders the page knows what variant is used for this document. Because of this line it knows what set of rules it should apply to render this page. This is possible because each variant has its own Document Type Definition also known as DTD.

The three flavors of XHTML 1.0 are:

  • XHTML 1.0 Strict. This is used by authors who want really clean structural mark-up, free of any tags associated with layout. The use of this flavor should be combined with Cascading Style Sheets to get customized font, color, and layout effects.
  • XHTML 1.0 Transitional. To make a page accessible to the greater public this flavor of XHTML 1.0 should be used. The idea is to take advantage of XHTML features including style sheets but nonetheless to make small adjustments to the way mark-up currently is done for the benefit of those viewing your pages with older browsers which can't understand style sheets. So within this flavor it still is allowed to use a <body> tag in combination with bgcolor, text and link attributes for instance. These attributes are marked as deprecated though, so in future releases of XHTML they might not be part of the standard anymore and thus future browsers do not need to support these attributes anymore.
  • XHTML 1.0 Frameset. This is used when HTML Frames are necessary to partition the browser window into two or more frames.

Note that XHTML is much more stricter than HTML. An XHTML document actually is an XML document and therefor the strict XML rules also apply to XHTML. So all tags are lowercase and are properly nested. Each tag needs to have a closing tag. Even an <img> tag needs to be closed properly. It is allowed to use a shortcut method to close a tag that has no text within it and that in HTML wouldn't have a closing tag. For instance by using <img  /> the image tage is closed immediatly. It is very important to have the extra space. This is for backwards compatibility with old browsers.

Note that XHTML still is under development. It probably will be for a long while. But the standard which is available at this time is very usable. HTML is not obsolete yet, but still it is recommended when an existing HTML page is altered to turn that page into XHTML while you are already busy with the file. This will benefit the future...

Relevant links

See Also

Contact the author: Send an electronic mail to: pajtroon@dds.nl.
Peter's ICQ Number is: #3900785.

This page: Copyright © 2002 Peter A. J. Troon

Note: This page is part of the Peter Troon Site.