Answer the question
In order to leave comments, you need to log in
Do I need to specify the doctype in the svg file (exactly in a separate file, not in the inlan tag)?
in fact, you read the question (probably), I optimize the svg image (remove unnecessary things, combine them into groups, etc.), I came across this example of svg code
who is too lazy to follow the link - the svg element has a baseProfile attribute - I have problems with English, but according to circumstantial evidence, this attribute can replace the doctype (checked the image without doctype with a validator - no errors). In terms of file optimization, this is a trifle, but I would just like to find out for myself and calm down:
Is it necessary to specify the doctype in the svg file?
PS version svg 1.1
PSS can just give a link - I can read
Answer the question
In order to leave comments, you need to log in
Of course, the full version will be valid, but all browsers and programs understand without metadata:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
baseProfile="full"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:ev="http://www.w3.org/2001/xml-events"
width="100%" height="100%">
<rect fill="white" x="0" y="0" width="100%" height="100%" />
<rect fill="silver" x="0" y="0" width="100%" height="100%" rx="1em"/>
</svg>
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg"
<!-- некоторые функции и фильтры работают только с указанием соответствующих стандартов, так что выкидывать всё подряд ни в коем случае не стоит -->
width="100%" height="100%">
<rect fill="white" x="0" y="0" width="100%" height="100%" />
<rect fill="silver" x="0" y="0" width="100%" height="100%" rx="1em"/>
</svg>
The SVG community, and in particular the developer Jonathan Watt , have come to the conclusion that in some cases when using Mozilla Firefox with a built-in SVG viewer, the content of the DOCTYPE declaration can be a source of errors. Therefore, they recommend against using the DOCTYPE declaration in SVG versions 1.0 and 1.1. Instead, it is recommended to include the baseProfile attribute on the root svg element with a value of “full”
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.1"
baseProfile="full"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:ev="http://www.w3.org/2001/xml-events"
width="100%" height="100%">
<rect fill="white" x="0" y="0" width="100%" height="100%" />
<rect fill="silver" x="0" y="0" width="100%" height="100%" rx="1em"/>
</svg>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question