written by: George Garza•edited by: Linda Richter•updated: 5/19/2011
Extensible Hypertext Markup Language (XHTML) belongs to a family of XML markup languages, which are the tools that web pages are written in. XHTML mirrors and extends the widely used Hypertext Markup Language (HTML). It has different formatting rules and stricter requirements but is more reliable.
slide 1 of 6
What Is HTML?
In order to understand XHTML, it is necessary to understand the origins. There were two web development languages that came before XHTML. One is HTML and the other is XML.
However, in order to talk about HTML, we must first talk about SGML (Standard Generalized Markup Language). It is not a language per se. But it is a language for defining markup languages such as HTML and for specifying the tagging elements in a document. So it is a language used to create markup languages. With this basic information, we can turn to HTML.
Hyper text mark up language (HTML) was the first language used to design web pages, and its primary goal was to display data in a web browser. How it works is a simple process because "tags" are used. With HTML all design elements like text and graphics are "tagged" with codes that instruct the web browser how to display the files. For example, <H1>What Is HTML?</H1> is the tag used to create the heading.
Designed in the early 1990s by Tim Berners-Lee, HTML has seen a number of changes and versions. The versions and revisions are maintained by the World Wide Web Consortium (W3C) since 1996. The current version is HTML 4. But in January 2008, a working draft of HTML 5 was published by the W3C working group. HTML 4.01 is the current version in use, but HTML 5 should be released in 2011.
XML stands for EXtensible Markup Language and it is similar to but different from HTML. The main difference is that XML was designed to carry, transport and store data, focusing on what data is--not to display data and how it looks, like HTML. Also another difference is that XML tags are not predefined. You must define your own tags, and it is self-descriptive.
Here is an example of XML code:
<heading>Ball Game Reminder</heading>
<body>Don't forget we have tickets to the game this weekend!</body>
All of the tags (for example <heading> </heading>) are defined on the go. They are not predefined.
XHTML is a hybrid language of XML and HTML. XHTML is almost identical to HTML 4.01 with only a few variations. XHTML improves upon HTML and enables consistency across browser platforms. This means that present and future browser versions will be able to use web pages that have an XHTML design without problems. It is a cleaner but stricter version of HTML 4.01.
Here are some examples of valid and invalid XHTML tags.
<!-- This is invalid in XHTML -->
<p>This sentence is not written according to XHTML syntax.
<!-- This is also invalid in XHTML --> <img src="/images/xhtml.gif">
<!-- This is now valid code in XHTML -->
<p>This sentence is not written according to XHTML syntax.</p> [Note the ending tag]
<!-- This code is also valid now --> <img src="/images/xhtml.gif" /> [Note the ending tag]
The real history of XHTML began with a draft document called "Reformulating HTML in XML", released by the World Wide Web Consortium in December 1998. It was a specification called XHTML 1.0 that reformulated HTML in XML without adding any new elements or attributes. This was followed in May 1999, with the W3 Consortium announcing that HTML 4.0 had been recast as an XML application. It was recast as XHTML. Then on January 26, 2000, the W3C publicly released the specifications that defined XHTML 1.0. XHTML was a programming success, but in May 31, 2001, the W3C considered XHTML as a separate language from HTML and started development of HTML 5.0.
slide 5 of 6
HTML5 and XHTML5
HTML5 should be ready to be used by developers by 2011. Alongside it is XHTML5, also in development. XHTML5 is an update to XHTML 1.x .
What does XHTML5 bring to the table? XHTML5 uses XML and is a serialization of HTML5. XML documents must be served with an XML Internet media type such as application/xhtml+xml or application/xml. XHTML5 requires strict, well-formed syntax, the kind typically found in XML. Furthermore, in XHTML5 the HTML5 doctype syntax is optional and may be omitted.