Movatterモバイル変換


[0]ホーム

URL:


  1. Glossary
  2. XHTML

XHTML

XHTML is a term that was historically used to describeHTML documents written to conform withXML syntax rules.

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

html
<!-- Content-Type: text/html --><!doctype html><html lang="en-US">  <head>    <meta charset="utf-8" />    <title>HTML</title>  </head>  <body>    <p>I am a HTML document</p>  </body></html>
xml
<!-- Content-Type: application/xhtml+xml --><?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">  <head>    <title>XHTML</title>  </head>  <body>    <p>I am a XHTML document</p>  </body></html>

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

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp