SVG <text>
- Página anterior Ruta de SVG
- Página siguiente Pincel de SVG
Texto SVG - <text>
<text>
elemento se utiliza para definir texto.
ejemplo 1
Escribe un texto:
这 es el código SVG:
<svg height="30" width="200"> <text x="0" y="15" fill="red">I love SVG!</text> </svg>
ejemplo 2
Texto girado:
这 es el código SVG:
<svg height="60" width="200"> <text x="0" y="15" fill="red" transform="rotate(30 20,40)">I love SVG</text> </svg>
ejemplo 3
<text>
elemento puede estar con <tspan>
elementos juntos, se disponen en cualquier cantidad de subgrupos. Cada <tspan>
elemento puede contener diferentes formatos y posiciones.
Texto multilinea (usando el elemento <tspan>):
这 es el código SVG:
<svg height="90" width="200"> <text x="10" y="20" style="fill:red;">Lineas varias:</text> <tspan x="10" y="45">Primera línea.</tspan> <tspan x="10" y="70">Segunda línea.</tspan> </text> </svg>
ejemplo 4
como texto de enlace (con <a>
elemento):
这 es el código SVG:
<svg height="30" width="200" xmlns:xlink="http://www.w3.org/1999/xlink"> <a xlink:href="www.codew3c.com/graphics/index.asp" target="_blank"> <text x="0" y="15" fill="red">I love SVG!</text> </a> </svg>
- Página anterior Ruta de SVG
- Página siguiente Pincel de SVG