SVG无法被编辑器编辑的解决方法

林一二2021年11月01日 00:04
Ref:
Keywords:

使用SVG 在线编辑器打开来自太微的 SVG 时会发现无法被识别。

修改为可被编辑器识别的形式

需要补上 xmlns="http://www.w3.org/2000/svg" 才行,例如将原本的:

<svg width="22pt" height="22pt" class="tc-image-excise tc-image-button" viewBox="0 0 128 128">

需要改为

<svg xmlns="http://www.w3.org/2000/svg" width="22pt" height="22pt" class="tc-image-excise tc-image-button" viewBox="0 0 128 128">

改回原本的单位

在用编辑器改过之后,可能单位会变成 width="128" height="128" ,需要改回原来的 width="22pt" height="22pt" viewBox="0 0 128 128"