XHTML

XHTML is a term that was historically used to describe HTML documents written to conform with XML syntax rules.

The following example shows an HTML document and corresponding "XHTML" document, and the accompanying HTTP Content-Type headers they should be served with.

HTML document

html




  
    
    HTML
  
  
    

I am a HTML document

XHTML document

xml




  
    XHTML
  
  
    

I am a XHTML document

In practice, very few "XHTML" documents are served over the web with a Content-Type: application/xhtml+xml header. Instead, even though the documents are written to conform to XML syntax rules, they are served with a Content-Type: text/html header — so browsers parse those documents using HTML parsers rather than XML parsers.

See also