4 人の貢献者による編集:
この記事はまだ日本語に翻訳されていません。MDN の翻訳はボランティアによって行われています。是非 MDN に登録し、私たちの力になって下さい。

Within a <text> element, text and font properties and the current text position can be adjusted with absolute or relative coordinate values by including a tspan element.

Usage context

CategoriesText content element, Text content child element
Permitted contentCharacter data and any number of the following elements, in any order:
Descriptive elements
<a>, <altGlyph>, <animate>, <animateColor>, <set>, <tref>, <tspan>


Source code
<?xml version="1.0"?>
<svg width="250" height="40" viewBox="0 0 250 40"
     xmlns="http://www.w3.org/2000/svg" version="1.1">

    font: 20px Verdana, Helvetica, Arial, sans-serif;

	fill: red;
	font-weight: bold

    <text x="15" y="30">You are 
    	a banana
Output result

» tspan.svg


Global attributes

Specific attributes

DOM Interface

This element implements the SVGTSpanElement interface.


Specification Status Comment
Scalable Vector Graphics (SVG) 2
The definition of '<tspan>' in that specification.
Working Draft  
Scalable Vector Graphics (SVG) 1.1 (Second Edition)
The definition of '<tspan>' in that specification.
Recommendation Initial definition

Browser compatibility

Feature Chrome Firefox (Gecko) IE Opera Safari
Basic support 1.0 1.5 (1.8)[1] 9.0 9.0 3.0.4
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 3.0 1.0 (1.8)[1] Not supported (Yes) 3.0.4

The chart is based on these sources.

[1] Various presentation attributes don't work. The attribute rotate was implemented in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1).

See also


 このページに貢献する: Sebastianz, kscarfone, Jeremie, Manuel_Strehl
 最終更新者: Sebastianz,