SVG Core Attributes

The SVG core attributes are all the common attributes that can be specified on any SVG element.

Attributes

id
Defines a unique identifier (ID) which must be unique in the whole document. Its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with CSS).
Value: Any valid ID string; Animatable: No
lang

Participates in defining the language of the element, the language that non-editable elements are written in or the language that editable elements should be written in. The tag contains one single entry value in the format defined in the Tags for Identifying Languages (BCP47) IETF document.

SVG 2 introduce the new lang attributes. If both lang and xml:lang attribute are used, xml:lang has priority over lang.

Value: Any valid language ID; Animatable: No

tabindex
The tabindex SVG attribute allows you to control whether an element is focusable and to define the relative order of the element for the purposes of sequential focus navigation.
Value type: <integer>; Animatable: No
xml:base
Specifies a base IRI other than the base IRI of the document.
Value type: <IRI>; Animatable: No
xml:lang

It is a universal attribute allowed in all XML dialects to mark up the natural human language that an element contains. It's almost identical in usage to HTML's lang, but in conforming XML 1.0 documents, it does not allow the use of a null attribute value (xml:lang="") to indicate an unknown language. Instead, use xml:lang="und".

SVG 2 introduce the new lang attributes. If both lang and xml:lang attribute are used, xml:lang has priority over lang.

Value: Any valid language ID; Animatable: No

xml:space Deprecated since SVG 2

SVG supports the standard XML attribute xml:space to specify the handling of white space characters within a given <text> element's character data.

Note: Instead of using the xml:space attribute you should use the white-space CSS property.

Value: default | preserve; Animatable: No

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
idChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
langChrome ? Edge ? Firefox ? IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?
tabindexChrome Full support YesEdge Full support YesFirefox Full support 51IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 51Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
xml:base
Deprecated
Chrome ? Edge ? Firefox ? IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?
xml:lang
Deprecated
Chrome ? Edge ? Firefox ? IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?
xml:space
Deprecated
Chrome ? Edge ? Firefox Full support 3IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile ? Firefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.

Document Tags and Contributors

Contributors to this page: Jeremie
Last updated by: Jeremie,