xml:lang - SVG: Scalable Vector Graphics 编辑
The xml:lang
attribute specifies the primary language used in contents and attributes containing text content of particular elements.
It is a universal attribute allowed in all XML dialects to mark up the natural human language that an element contains.
There is also a lang
attribute (without namespace). If both of them are defined, the one with namespace is used and the one without is ignored.
All elements are using this attribute.
<svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
<text xml:lang="en-US">This is some English text</text>
</svg>
Usage notes
Value | <language-tag> |
---|---|
Default value | None |
Animatable | No |
<language-tag>
This value specifies the language used for the element. The syntax of this value is defined in the BCP 47 specification.
The most common syntax is a value formed by a lowercase two-character part for the language and an uppercase two-character part for the region or country, separated by a minus sign, e.g.
en-US
for US English orde-AT
for Austrian German.
Specifications
Specification | Status | Comment |
---|---|---|
Scalable Vector Graphics (SVG) 2 The definition of 'xml:lang' in that specification. | Candidate Recommendation | Made the lang attribute (without namespace) available on all elements and defined the interaction between both. |
Scalable Vector Graphics (SVG) 1.1 (Second Edition) The definition of 'xml:lang' in that specification. | Recommendation | Initial definition |
Browser compatibility
BCD tables only load in the browser
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论