Search this site...

XHTML (eXtensible HTML)

As a web developer, you may be aware that the HTML language has a loose structure. This loose structure, over the years, has resulted in many inconsistent and incompatibility issues as different browser vendors tried to interpret differently the meaning of HTML code.

To establish better ground rules for developing web pages, XHTML (eXtensible HTML) technology was developed. XHTML is a subset of XML (Extensible Markup Language). While XML can be used to structure virtually any information, XHTML can be used to create highly structured web pages. XHTML enforces the structure of XML within the HTML language.

The huge benefit of using XHTML documents is that they can be validated or analyzed for correctness. A validated XHTML document indicates that it meets all the coding requirements of the XML language and the rules of an XHTML schema (document type definition or DTD).

Now, you may be thinking that XHTML is probably a complicated technology that requires you to learn set of unfamiliar instructions for creating web pages. Actually, if you already know HTML, you can learn XHTML without much difficulty because XHTML is not all that different from HTML.

What is XHTML?

The extensible Hypertext Markup Language (XHTML) is very like HTML (Hypertext Markup Language). Like HTML, XHTML is used for creating interactive web pages. The output of XHTML is very similar to that of HTML. In other words, users can still click on links to move between pages, fill out forms, search databases, play animations, and so on. Similar to what HTML does XHTML works behind-the-scenes to instruct web browsers to format and display content on web pages.

So what is a markup language? A markup language consists of scripting code that prepares a document for presentation. If you were to analyze XHTML code, you would find that is just a text file that contains the content you want to display in your web document. See figure 1 as an example of code of document:

An example of XHTML code for a web page document
An example of XHTML code for a web page document

As the figure shows, XHTML is nothing like a web page. Instead, it shows parts of the XHTML instruction that consist of elements, tags, and attributes. Figure 2 shows a webpage that is created from scripted markup of collective work of elements, tags, and attributes.

Example of a web page created from XHTML code
Example of a web page created from XHTML code