Webmaster tips » HTML

Jul 24, 2006
Phillip Kimpo Jr.

XHTML (eXtended Hypertext Markup Language): An Overview

Average rating:
  • 2 out of 5 Stars
Rate this article

Many Web pages today are poorly written. Syntactically incorrect HTML code may work in most browsers even if it does not follow HTML rules. Browsers employ heuristics to deal with these flawed Web pages; however, Web-enabled wireless devices (such as PDAs) cannot accommodate these hefty Web browsers. The next step in HTML's evolution comes in the form of XHTML (eXtended Hypertext Markup Language), which is basically a combination of HTML and XML.


As with XML, the World Wide Web Consortium (W3C) was the force behind XHTML's development. When XML was introduced, a two-day workshop was held to discuss whether a new version of HTML in XML was needed. The answer was a resounding "Yes."

The first W3C Recommendation to be published was XHTML 1.0, which reformulates HTML 4.0.1 in XML and combines the strengths of the two markup languages. The recommendation followed from earlier work on HTML 4.0.1, HTML 4.0, HTML 3.2, and HTML 2.0.

The second W3C Recommendation was XHTML Basic. It boasts of images, forms, basic tables, and object support. XHTML Basic is designed for Web clients that do not support the full set of XHTML features; examples of these clients are mobile phones, PDAs, pagers, and set-top boxes.

The third W3C Recommendation to come out was on the Modularization of XHTML. It provides a means for extending and creating subsets for XHTML. The modular design introduced by this recommendation underscores the invalidity of the "one-size-fits-all" approach nowadays, especially with the advent of Web browsers that vary in capabilities (e.g. cellphone browser vs. desktop PC browser).

The fourth W3C Recommendation was XHTML 1.1 (Module Based XHTML). Here, a new XHTML document type is defined based on the modular design of the third XHTML Recommendation.


XHTML is a family of current and future document types and modules that contains all of the HTML 4.0.1 elements combined with XML syntax. XHTML is classified as an XML Application, and thus possess many XML features.

XHTML, described by Andrew Tanenbaum as a “language that is Very Picky”, differs itself from HTML by its stricter syntax.

The current version of XHTML that is supported by browsers is XHTML 1.0, a W3C Recommendation discussed earlier. There are three variants to XHTML 1.0:

XHTML 1.0 Strict -- used for exceptionally clean structural markup; the CSS (Cascading Style Sheet) language can be used with this variant to get the desired font, color, and layout effects XHTML 1.0 Transitional -- best option for Web authors with webpages meant for general public access; takes advantage of XHTML features including style sheets XHTML 1.0 Frameset -- used to partition the Web browser window into two or more frames


The important thing to remember here is that XHTML is extended HTML. This means that writing XHTML code is very similar to writing HTML code. The only difference lies in the fact that XHTML is more strict and more structured than its progenitor.

A good way of familiarizing yourself with XHTML is to get old HTML code and bring it up to XHTML standards. You'll need to keep in mind several rules:

All elements must be properly nested. All elements must be properly closed. All tag names must be in lower case. All attribute names must be in lower case. All attribute values must be properly quoted. The "id“ attribute replaces the ”name" attribute. All images must have alternate ("alt") text -- make the page accessible for devices that don't load images, or screen-readers for the blind. All XHTML documents must have a DOCTYPE declaration, as well as the "html", "head", and "body" elements. The "title“ element must be present within the ”head" element.

A good hands-on tutorial on XML can be found at http://w3schools.com.

Discpiline and practice will allow you to master XHTML in no time. However, if you don't want to convert an existing HTML document to XHTML yourself, you can use HTML Tidy, a software that does the transformation for you. Also, you can use Amaya, a web browser and editor that saves HTML documents as XHTML ones

Print! Print this article   Bookmark:

About The Author
Phillip Kimpo Jr. is a member of the Association for Computing Machinery (ACM). He keeps a tech blog at Crimson Crux, and is with Isulong SEOPH.
Rate This Article
How would you rate the quality of this content? Currently rated: 2 out of 5 stars. 4 people have rated this article.
Use your mouse pointer to select as many stars as you want, and press the left mouse button to vote.
  • 2 out of 5 Stars
  • 1
  • 2
  • 3
  • 4
  • 5
Other HTML Articles
Rating: 3.5 stars
The Myth of W3C Compliance? by Sasch Mayer (Jul 30, 2007)
The past few years have seen a huge increase in the number of search engine optimisers preaching about the vital importance of W3C Compliance as part of any effective web promotion effort. But is compliant code really the 'Magic SEO Potion' so many promoters make it out to be?...
Rating: 3.3 stars
3 Principles of HTML Code Optimization by George Peirson (May 5, 2008)
Just like spring cleaning a house, the html code of your web pages should get periodic cleaning as well. Over time, as changes and updates are made to a web page, the code can become littered with unnecessary clutter, slowing down page load times and hurting the efficiency of your web page...
Rating: 3.8 stars
Interactive Forms with HTML and Javascript by Brian Zimmer (Jul 2, 2006)
Forms are easy enough to create when they are simple, like search boxes. But what if you need them to be complex? How about changing the forms based on input by the viewer? This is where interactive forms using Javascript and HTML can help...
Rating: 3.2 stars
Writing Semantic HTML by Jesse Skinner (May 2, 2006)
Semantic HTML means using HTML tags for their implied meaning, rather than just using (meaningless) div and span tags for absolutely everything. Why would you want to do this? Depending on the tag, the content in the tag can be interpreted in a certain way...
Rating: 3.6 stars
A practical guide to meta tags - NAME or HTTP-EQUIV? by Andrei Smith (Jan 20, 2006)
META tags are a way for you to define your web page and web site to the outside world. You can declare the keywords and description, which help your placement in search engines. In addition, you can specify who owns the copyright, how often the page is to be visited by search engines and many other useful pieces of information...