XHTML - Extensible HyperText Markup Language
XHTML = XML + HTML XHTML is a reformulation of HTML 4.0 as an application of XML. XHTML was released as a Recommendation by the W3C on January 26, 2000. "XHTML 1.0 connects the present Web to the future Web, It provides the bridge to page and site authors for entering the structured data, XML world, while still being able to maintain operability with user agents that support HTML 4." -- Tim Berners-Lee, W3C Director.
Differences between HTML and XHTML
- The <head> and <body> elements cannot be omitted.
- XHTML is case sensitive
- XHTML tags are all in lowercase
- XHTML is a stricter, tidier version of HTML
- Every tag must be paired with a close tag. Tags that don't normally have a close tag, must terminate with a forward slash, i.e. <BR/>
- Elements must nest and not overlap
- All attributes must be enclosed in single or double quotes.
- Attribute-value pairs cannot be minimized, i.e. <td nowrap> must be written <td nowrap="nowrap">
- The name attribute is replaced by the id attribute (for a, applet, frame, iframe, and img elements)
- script and style elements need to have the contents enclosed in
<![CDATA[
...script/style content...
]]>
- An XHTML document consists of three main parts: the DOCTYPE, the Head, and the Body.
- The DOCTYPE definition specifies the document type:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
The three document types are STRICT, TRANSITIONAL, and FRAMESET. STRICT should be used with clean documents that use Cascading Style Sheets
- The html tag follows the DOCTYPE tag and must have a namespace declaration
<html xmlns = "http://www.w3.org/1999/xhtml">
- The head element contains the title element and any meta data for the document
- Pages written in XHTML should work well in most browsers.
- The tags and attributes for XHTML are almost identical to HTML
- XHTML is more portable
You can use the Quick Example as a template to create your XHTML documents. Once you have created your XHTML document, you can click on the image at the bottom or go to the address http://validator.w3.org/check/referer, which will connect with the W3C to validate whether your document conforms with the XHTML standards.
Some Definitions
elementAn element has three parts: a start tag, the content, and an end tag. Most tags have 'closing tags' - </p>, which indicates where the effect of the 'opening' tag stops.
URIuniform resource identifier
XML namespacesAn XML namespace is a collection of names which are used in XML documents as element types and attribute names. These are identified by a URI reference. I.e.,the XHTML namespace is the list of valid tags that can be used in XHTML.
XHTML Resources
Click here to return to Wayne's World's homepage:
written by Wayne Summers summers_wayne@ColumbusState.edu