W3cubDocs

/SVG

<title>

Each container element or graphics element in an SVG drawing can supply a <title> element containing a description string where the description is text-only. When the current SVG document fragment is rendered as SVG on visual media, <title> element is not rendered as part of the graphics. However, some user agents may, for example, display the <title> element as a tooltip. Alternate presentations are possible, both visual and aural, which display the <title> element but do not display path elements or other graphics elements. The <title> element generally improves accessibility of SVG documents.

Generally <title> element should be the first child element of its parent. Note that those implementations that do use <title> to display a tooltip often will only do so if the <title> is indeed the first child element of its parent.

Usage context

Categories Descriptive element
Permitted content Any elements or character data

Attributes

Global attributes

Specific attributes

There is no specific attributes

DOM Interface

This element implements the SVGTitleElement interface.

Example

<svg width="500" height="300" xmlns="http://www.w3.org/2000/svg">
  <g>
    <title>SVG Title Demo example</title>
    <rect x="10" y="10" width="200" height="50"
    style="fill:wheat; stroke:blue; stroke-width:1px"/>
  </g>
</svg>

Specifications

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 1 Yes 1.5 9 8 3
Tooltip display ? ? 4 ? ? ?
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support 3 Yes Yes 4 Yes 3 ?
Tooltip display ? ? ? ? ? ? ?

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title