HTML Guides for version
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
The version attribute on the <svg> element is obsolete in SVG 2 and is no longer recognized as a valid attribute by the W3C HTML validator.
The version attribute was used in SVG 1.0 and SVG 1.1 to indicate which specification the SVG content conformed to, with values like "1.0" or "1.1". However, SVG 2 — which is the version used when SVG is embedded in HTML5 documents — dropped this attribute entirely. It never had any practical effect on how browsers rendered SVG content, so removing it is safe and has no impact on functionality.
Similarly, the baseProfile attribute and the xmlns:xlink namespace declaration are also obsolete when using inline SVG in HTML5. You can safely remove all three.
Bad Example
<svgversion="1.1"xmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"width="100"height="100">
<circlecx="50"cy="50"r="40"fill="blue"/>
</svg>
Fixed Example
<svgxmlns="http://www.w3.org/2000/svg"width="100"height="100">
<circlecx="50"cy="50"r="40"fill="blue"/>
</svg>
If your SVG files are exported from tools like Illustrator, Inkscape, or Figma, they often include the version attribute by default. You can safely strip it out manually or use an SVG optimizer like SVGO to clean up unnecessary attributes automatically.
In earlier versions of HTML, the version attribute on the <html> element served as a way to indicate the DTD (Document Type Definition) the document followed. For example, you might have seen something like <html version="-//W3C//DTD HTML 4.01//EN">. This was largely redundant even then, because the <!DOCTYPE> declaration at the top of the document already communicated the same information to browsers and validators.
With the introduction of HTML5, the version attribute was officially marked as obsolete. The HTML Living Standard maintained by WHATWG does not define or support it. Modern browsers completely ignore it, so it has no functional effect on rendering or behavior. However, keeping it in your markup produces a validation warning from the W3C HTML Validator and adds unnecessary clutter to your code.
Removing this attribute has no side effects. The <!DOCTYPE html> declaration is the only mechanism needed to signal that your document uses the current HTML standard. Keeping your markup clean and free of obsolete attributes improves maintainability and ensures your documents pass validation without unnecessary warnings.
How to fix it
- Locate the
<html>tag in your document. - Remove the
versionattribute and its value entirely. - Ensure you have a valid
<!DOCTYPE html>declaration at the top of the document. - Keep the
langattribute on the<html>element, as it is important for accessibility and internationalization.
Examples
Incorrect: using the obsolete version attribute
<!DOCTYPE html>
<htmlversion="-//W3C//DTD HTML 4.01//EN"lang="en">
<head>
<title>My Page</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html>
This triggers the W3C validator warning: The "version" attribute on the "html" element is obsolete.
Correct: version attribute removed
<!DOCTYPE html>
<htmllang="en">
<head>
<title>My Page</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html>
The version attribute has been removed, and the document remains fully valid. The <!DOCTYPE html> declaration and the lang attribute are the only things needed on the <html> element for a well-formed, standards-compliant document.
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
Pro Trial
Full Pro access. Cancel anytime.
Start Pro Trial →Join teams across 40+ countries