lang - SVG: Scalable Vector Graphics 编辑

The lang attribute specifies the primary language used in contents and attributes containing text content of particular elements.

There is also an xml:lang attribute (with namespace). If both of them are defined, the one with namespace is used and the one without is ignored.

In SVG 1.1 there was a lang attribute defined with a different meaning and only applying to <glyph> elements. That attribute specified a list of languages in BCP 47 format. The glyph was meant to be used if the xml:lang attribute exactly matched one of the languages given in the value of this parameter, or if the xml:lang attribute exactly equaled a prefix of one of the languages given in the value of this parameter such that the first tag character following the prefix was "-".

All elements are using this attribute.

<svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
  <text lang="en-US">This is some English text</text>
</svg>

Usage notes

Value<language-tag>
Default valueNone
AnimatableNo
<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 or de-AT for Austrian German.

Specifications

SpecificationStatusComment
Scalable Vector Graphics (SVG) 2
The definition of 'lang' in that specification.
Candidate RecommendationMade 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 'lang' in that specification.
RecommendationDeprecated definition of the attribute for <glyph> elements

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:58 次

字数:3856

最后编辑:8 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文