Do I need to declare the SVG Version in the tag?

Asked

Viewed 30 times

1

I have a question about the need to declare the SVG version in the tag <svg>

I know the SVG started with the version 1.0, 1.1, 1.2 and now it’s in the version 2.0. Some SVG see with the version declaration and others without, but both are rendered normally by the Browser. I also know that there are several changes between the version 1.2 and 2.0.

There was the doubt, since I do not declare the version of SVG as the browser will know which version I am used?
There is indeed a need to declare version since they have very different things between one version and another?

Example with version="1.1" declared.

<svg version="1.1" x="0px" y="0px" width="612px" height="502.174px" viewBox="0 65.326 612 502.174" >
    <ellipse class="ground" cx="183.5" cy="187.5" rx="159" ry="80"/>
</svg>

Example without version declared

<svg viewBox="0 0 30 10">
  <circle id="myCircle" cx="5" cy="5" r="4"/>
</svg>

1 answer

2


There is no.

In accordance with documentation on MDN, the attribute version is purely informative, without any influence on how the elements will be processed or rendered.

So much so that from version 2.0 attribute is obsolete.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.