From Edutechwiki - Reading time: 8 minXHTML is a family of current and future Web document types and modules that reproduce, subset, and extend HTML4.01. XHTML family document types are XML conformant, and designed to work in conjunction with XML-based editors and user agents.
XHTML markup is pretty much the same as HTML markup, i.e. the XHTML 1.0 version use the same tags as the respective HTML 4.01x version (with some exceptions)
See also:
XHTML documents must be wellformed and valid according to the XML specification, except that an XML declaration is not mandatory (only encouraged).
All XHTML tags were defined in lower case. In XML, as opposed to SGML, case does matter.
In addition:
<html xmlns= "http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <h:html xmlns:h="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

According to the XHTML2 Working Group Home Page (retrieved 15:19, 1 September 2009 (UTC)), XHTML 1.0 is specified in three "flavors":
(1) XHTML 1.0 Strict - Use this when you want really clean structural mark-up, free of any markup associated with layout. Use this together with W3C's Cascading Style Sheet language (CSS) to get the font, color, and layout effects you want.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
(2) XHTML 1.0 Transitional - Many people writing Web pages for the general public to access might want to use this flavor of XHTML 1.0. The idea is to take advantage of XHTML features including style sheets but nonetheless to make small adjustments to your markup for the benefit of those viewing your pages with older browsers which can't understand style sheets. These include using the body element with bgcolor, text and link attributes.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
(3) XHTML 1.0 Frameset - Use this when you want to use Frames to partition the browser window into two or more frames.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Virtual Library</title>
</head>
<body>
<p>Moved to <a href="http://example.org/">example.org</a>.</p>
</body>
</html>
See the HTML and XHTML elements and attributes entry.
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:math="http://www.w3.org/1998/Math/MathML"
xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<title>XTHML with MATHML</title>
</head>
<body>
<p> <b>Corollary 2</b> [Contractive Sequence Theorem]
<em>If
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<mo>(</mo><msub><mi>x</mi> <mi>n</mi></msub><mo>)</mo></math>
is a sequence, for which there is a number
<math xmlns='http://www.w3.org/1998/Math/MathML'><mi>C</mi><mi><</mi><mn>1</mn></math>
such that <math xmlns='http://www.w3.org/1998/Math/MathML'><mo>|</mo>
<msub><mi>x</mi> <mrow><mi>n</mi><mo>+</mo><mn>2</mn></mrow></msub><mo>-</mo>
<msub><mi>x</mi><mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></msub>
<mo>|</mo><mo>≤</mo><mi>C</mi><mo>⋅</mo><mo>|</mo><msub><mi>x</mi>
<mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></msub>
<mo>-</mo><msub><mi>x</mi> <mi>n</mi></msub><mo>|</mo></math>
, then <math xmlns='http://www.w3.org/1998/Math/MathML'>
<mo>(</mo><msub><mi>x</mi> <mi>n</mi></msub><mo>)</mo></math>
converges;</em></p>
</body>
</html>
SVG example (you can see it here)
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:svg="http://www.w3.org/2000/svg">
<head>
<title>SVG within XHTML Demo</title>
</head>
<body>
<p> You can embed SVG into XHTML, provided that your browser natively implements
SVG. E.g. Firefox 1.5 supports most of static SVG.
</p>
The SVG part starts below <hr />
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400" height="300">
<!-- un petit rectangle avec des coins arroundis -->
<rect x="50" y="50" rx="5" ry="5" width="300" height="100" style="fill:#CCCCFF;stroke:#000099"/>
<!-- un texte au meme endroit -->
<text x="55" y="90" style="stroke:#000099;fill:#000099;font-size:24;">
HELLO cher visiteur
</text>
</svg>
<hr />
The SVG part ended above
</body>
</html>
It is also possible to include XHTML tags in any XML document markup. E.g. here is an example: (live example)
<?xml version="1.0" ?> <?xml-stylesheet href="xml_plus_xhtml.css" type="text/css"?> <page xmlns:html="http://www.w3.org/1999/xhtml" updated="jan 2007"> <title>Hello friend</title> <list> <!-- we use an HTML tag below to include a picture --> <html:img src="photo.jpg"/> <item price="10"> White plate </item> <item price="20"> Gold plate </item> <item price="15"> Silver plate </item> </list> <comment> Written by <html:a href="http://tecfa.unige.ch/tecfa-people/schneider.html">DKS/Tecfa</html:a> , feb 2007 </comment> </page>
IE support
XHTML was badly supported by IE6, IE7 and IE8. These Microsoft browsers did not recognize the application/xhtml+xml mimetype, which made it difficult to include XSLT stylesheets or other languages such as SVG or MathML. The reason why MS did not support "real" XHTML is simple. They would have had to rewrite the whole parser as it is explained by Chris Wilson in the IEBlog. Microsoft finally got there with IE9/10. But by then the XHTML "concept" was dead and replaced by HTML5
If you send XHTML as simple HTML "text/html" files you will loose all XML-related advantages. XHTML id render in IE 6-8 since it was simply translated to HTML 4.1.
There were workarounds to somewhat deal with IE 6/7/8
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- prevent IE from rendering a DOM tree --> <?xml-stylesheet type="text/xsl" href="xhtml.xsl"?>
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:copy-of select="."/> </xsl:template> </xsl:stylesheet>
See Dean Edwards and Anne Van Kersteren
XML requirements
XML states that pages with errors should not display. Since most programmers can't produce correct (X)HTML code, this can be seen a stumbling block for creating web sites and web applications ....
To author (X)HTML Pages you can:
See HTML links (a page with links for both HTML and XHTML)