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

查看:27
本文介绍了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天全站免登陆