Skip to main content

HTML Guide

Bad value “http://www.w3.org/1999/html” for the attribute “xmlns” (only “http://www.w3.org/1999/xhtml” permitted here).

Use xmlns="http://www.w3.org/1999/xhtml", not http://www.w3.org/1999/html.

The xmlns attribute specifies the XML namespace. For XHTML documents, the only valid value is http://www.w3.org/1999/xhtml. Using http://www.w3.org/1999/html is incorrect and causes validation errors. For regular HTML5 (not XHTML), you do not need the xmlns attribute at all.

Correct XHTML Example:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <title>XHTML Example</title>
  </head>
  <body>
    <p>Hello, XHTML world!</p>
  </body>
</html>

Correct HTML5 Example (no xmlns attribute):

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>HTML5 Example</title>
  </head>
  <body>
    <p>Hello, HTML5 world!</p>
  </body>
</html>

For XHTML, always use xmlns="http://www.w3.org/1999/xhtml". For regular HTML5, omit the xmlns attribute.

Learn more:

Related W3C validator issues