SVG <text>
- Página Anterior Caminho SVG
- Próxima Página Traço SVG
Texto SVG - <text>
<text>
O elemento é usado para definir texto.
exemplo 1
Escreva um texto:
Este é o código SVG:
<svg height="30" width="200"> <text x="0" y="15" fill="red">Eu amo SVG!</text> </svg>
exemplo 2
Texto rotacionado:
Este é o código SVG:
<svg height="60" width="200"> <text x="0" y="15" fill="red" transform="rotate(30 20,40)">Eu amo SVG</text> </svg>
exemplo 3
<text>
elemento pode ser <tspan>
elementos juntos, organizados em qualquer número de subgrupos. Cada <tspan>
O elemento pode conter diferentes formatos e posições.
Texto de várias linhas (usando o elemento <tspan>):
Este é o código SVG:
<svg height="90" width="200"> <text x="10" y="20" style="fill:red;">Linhas várias:</text> <tspan x="10" y="45">Primeira linha.</tspan> <tspan x="10" y="70">Segunda linha.</tspan> </text> </svg>
exemplo 4
como texto de link (com <a>
elemento):
Este é o 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">Eu amo SVG!</text> </a> </svg>
- Página Anterior Caminho SVG
- Próxima Página Traço SVG