The xmlns attribute is required for SVG files
but optional for inlined SVGs.
The version attribute is always optional.
Table of contents
The xmlns and xmlns:xlink attributes
-
The
xmlnsandxmlns:xlinkattributes are optional for inlined SVGs in HTML. -
The
xmlnsattribute is required for SVG files. -
The
xmlnsattribute is required for SVGs in CSS, e.g.:background-image: url( 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg">...</svg>' ); -
The
xmlns:xlinkattribute is required for SVG files that containxlink:attributes. Similarly for SVGs in CSS.
The version attribute
The version attribute is ignored and thus always optional.
Plus it's deprecated since SVG 2.
Source
Are SVG parameters such as 'xmlns' and 'version' needed? on Stack Overflow