Skip to main content

HTML Guide

Attribute “xmlns:m” not allowed here.

The xmlns:m attribute is not permitted on the html element in HTML5 documents.

HTML5 allows only certain attributes on the html element, specifically lang and dir (and the standard xmlns in XHTML serialization contexts), but not custom XML namespaces like xmlns:m. The xmlns:m attribute is typically used in XML-based documents (such as MathML or Office markup) and is not valid in standard HTML5 syntax.

To resolve the error, remove the xmlns:m attribute from the html element. If you need to use namespace-prefixed elements or attributes (such as for Office documents or MathML), you should use XHTML serialization (served as application/xhtml+xml) or rework your markup to be fully compatible with HTML5 without custom namespaces.

Incorrect usage:

<!DOCTYPE html>
<html xmlns:m="http://schemas.microsoft.com/office/2004/12/omml">
  <head>
    <title>Invalid Namespace Example</title>
  </head>
  <body>
    <!-- Content here -->
  </body>
</html>

Correct HTML5 usage:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Valid HTML Example</title>
  </head>
  <body>
    <!-- Content here -->
  </body>
</html>

If you require namespaces for specific elements (like MathML), use them directly without declaring a namespace on the html element, or switch to XHTML if your application truly requires namespace declarations. For most web applications, sticking to standard HTML5 elements and attributes ensures maximal compatibility and validator compliance.

Related W3C validator issues