svg xmlns属性值是否需要协议?可以是https还是相对的? [英] Does svg xmlns attribute value requires protocol? Can it be https or relative?

查看:96
本文介绍了svg xmlns属性值是否需要协议?可以是https还是相对的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

xmlns="http://www.w3.org/2000/svg"可以是xmlns="https://www.w3.org/2000/svg"吗?

还是xmlns="//www.w3.org/2000/svg"?

推荐答案

它实际上不是URL,它是一个名称空间,恰好看起来像URL.因此,它必须完全按照

It's not really a URL, it's a namespace that simply happens to look like a URL. As such it must be written exactly as

xmlns="http://www.w3.org/2000/svg"

省略http或将其更改为https将不起作用.

omitting the http or changing it to https will not work.

名称空间包含http的事实并不意味着SVG文件将使用http协议进行任何形式的通信. w3c可以将SVG命名空间定义为foo,在这种情况下,我们都将编写xmlns ="foo",而您甚至都不会问这样的问题.

The fact that the namespace contains http does not mean in any way that the SVG file will use the http protocol for any kind of communication. The w3c could have defined the SVG namespace as foo in which case we'd all be writing xmlns="foo" and you'd not even be asking such questions.

这篇关于svg xmlns属性值是否需要协议?可以是https还是相对的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆