问题描述
我正在验证我的代码,并得到以下错误
在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
$ b
结束。即你可以写一个路径为<路径>< / path> 或<路径/> ,但是你不能将它写成<路径>
I was validating my code, and got the following error 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" />
Now I know meta tags in HTML5 don't require the forward dash /, 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" >
Or… Using an explicit closing tag? Like so:
<path d="m53.911,10.023c-1.46-.898-3.195-1.019-4.699-1.019h-3.439c" > </path>
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 <path></path> or <path/> but you can't write it as <path>
这篇关于关闭SVG标签,显式还是自动关闭?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!