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.
This warning appears when an <svg> element carries a version attribute set to something other than 1.1, which is the only SVG version the W3C validator checks against. Removing the version attribute clears the warning and won't change how browsers draw the graphic.
The version attribute was meant to declare which SVG specification the content targets, with values like "1.0", "1.1", or "2.0". The validator can only check inline SVG against SVG 1.1, so when the attribute names a different version it has no ruleset to validate against and falls back to this warning. Browsers ignore the attribute when rendering, so dropping it has no visible effect.
This usually shows up in files exported from drawing tools, which write a version attribute by default. The baseProfile attribute is obsolete for inline SVG in HTML5 for the same reason, so you can remove it too.
Invalid example
<svgversion="2.0"xmlns="http://www.w3.org/2000/svg"width="100"height="100">
<rectx="10"y="10"width="80"height="80"fill="teal"/>
</svg>
Valid example
<svgxmlns="http://www.w3.org/2000/svg"width="100"height="100">
<rectx="10"y="10"width="80"height="80"fill="teal"/>
</svg>
If you have a lot of SVG files to clean up, an optimizer like SVGO can strip the version attribute automatically.
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