Beispiel:SVG-24-tspan.html
Aus SELFHTML-Wiki
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" >
<link rel="stylesheet" href="./Beispiel:SELFHTML-Beispiel-Grundlayout.css">
<style>
svg {
background: white;
border: thin dotted #337599;
width: 96%;
height: 300px;
padding: 0;
}
text {
font-family:verdana;
font-size: 24px;
fill: #337599;
}
#eins {
font-size: 48px;
font-weight: bold;
fill: #dfac20;
stroke: #333;
stroke-width: 1;
}
#zwei {
font-size: 48px;
font-weight: bold;
fill: #e32c04;
stroke: #333;
stroke-width: 1;
}
#drei {
font-size: 48px;
font-weight: bold;
fill: #5a9900;
stroke: #333;
stroke-width: 1;
}
</style>
<title>Beispiel: Text in SVG</title>
</head>
<body>
<h1>Änderung der Laufrichtung in SVG</h1>
<svg viewBox="0 0 800 300">
<text x="40" y="40">
<tspan id="eins">S</tspan>
<tspan id="zwei">V</tspan>
<tspan id="drei">G</tspan>
<tspan dx="10" dy="80">in einer neuen Zeile ... (relativ positioniert)</tspan>
<tspan x="10" y="175">und in noch einer ... (absolut positioniert)</tspan>
</text>
</svg>
</body>
</html>