关闭SVG标签,显式还是自动关闭? [英] Closing SVG tags, explicit or self closing?
问题描述
我正在验证我的代码,并得到以下错误 或...使用明确的结束标记?像这样: 无论您使用的验证是否正确, b SVG和MathML标记在HTML中自行关闭if他们以/> 结束。即你可以写一个路径为 I was validating my code, and got the following error Now I know meta tags in HTML5 don't require the forward dash Or… Using an explicit closing tag? Like so: What is the correct way of closing a path? Whatever validation you're using is working incorrectly. SVG and MathML tags are self closing within HTML if they end with />. I.e. You can write a path as 这篇关于关闭SVG标签,显式还是自动关闭?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!标记不能自动关闭。
< / code> 在IE浏览器中,路径
d =m53.911,10.023c-1.46-.898-3.195-1.019-4.699-1.019h-3.439c$ c $现在我知道HTML5中的元标记不要使用元标记要求正向短划线
/
,您只需使用 >
关闭它们。同样的事情适用于svg标签吗?像这样:
<路径
d = m53.911,10.023c-1.46-.898-3.195-1.019-4.699-1.019h-3.439c
>
<路径
d = m53.911,10.023c-1.46-.898-3.195-1.019-4.699-1.019h-3.439c
>
< / path>
$ b 关闭路径的方式?
$ b <路径>< / path>
或<路径/>
,但是你不能将它写成<路径>
Tag cannot be self-closing. Use an explicit closing tag.
in IE for my svg path because it's self closing.<path
d="m53.911,10.023c-1.46-.898-3.195-1.019-4.699-1.019h-3.439c"
/>
/
, you just close them with >
. Does the same thing apply to svg tags? Like so:<path
d="m53.911,10.023c-1.46-.898-3.195-1.019-4.699-1.019h-3.439c"
>
<path
d="m53.911,10.023c-1.46-.898-3.195-1.019-4.699-1.019h-3.439c"
>
</path>
<path></path>
or <path/>
but you can't write it as <path>