svg:svg是什么意思? [英] What is the meaning of svg:svg?

查看:186
本文介绍了svg:svg是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是什么意思?

.append("svg:svg")

我在HTML和D3代码中看到它。

I saw it in HTML and in D3 code. Does it add plugin of SVG?

推荐答案

在XHTML代码中,可以使用命名空间来区分其他基于XML的语言网页。这里,在标签svg之前使用命名空间svg。

In XHTML code, one can use namespaces to distinguish other XML-based languages included in the webpage. Here, the namespace "svg" is used before the tag "svg".

namespace:tagname

这在两个标签(例如,XHTML和SVG)具有相同名称并且您想要精确指定一个你指的。可以使用 xmlns 属性指定标记。如您所知,XHTML文档以

This can be useful in case two tags (for example, in XHTML and SVG) have the same name and you want to exactly specify which one you refer to. The tags can be specified with the xmlns attribute. As you know, XHTML documents start with

<html xmlns="http://www.w3.org/1999/xhtml">

您可以指定前缀

<html xmlns:prefix="http://www.w3.org/1999/xhtml">

然后您将使用

<prefix:head>
    <prefix:title></prefix:title>
</prefix:head>

类似地,您可以使用

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

而不是< svg> 包括你的svg图形。然后所有的svg标签将以 svgprefix 前缀开头。然而,如果你有子SVG节点,他们也需要定义这个 xmlns 属性。在这种情况下,定义前缀可能会更容易。

instead of just <svg> when including your svg graphic. Then all svg tags will start with the svgprefix prefix. However if you have child SVG nodes, they will also need this xmlns attribute to be defined. In such a case, defining the prefix will probably be easier.

这篇关于svg:svg是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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