slug: Web/SVG/Element/a
tags:
- Element SVG
- SVG
- SVG link
translation_of: Web/SVG/Element/a
---
{{SVGRef}}
Element <a>
SVG określa hiperłącze.
Element <a> HTML jest interpretowany tak samo jak element <a> SVG. Z tego względu w przypadku użycia selektora <a> w CSS lub JavaScript może mieć zastosowanie do nieprawidłowego elementu. Wypróbuj regułę @namespace, aby rozróżnić między nimi.
Użycie
{{svginfo}}
Atrybuty
Atrybuty globalne
Atrybuty specyficzne
No browser supports all XLink attributes.
- {{SVGAttr("href")}}
- {{SVGAttr("target")}}
- {{SVGAttr("xlink:show")}}
- {{SVGAttr("xlink:actuate")}}
- {{SVGAttr("xlink:href")}} {{deprecated_inline}}
DOM model
Element implementuje {{domxref("SVGAElement")}}.
Przykład
SVG
<svg width="140" height="30" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<a xlink:href="https://developer.mozilla.org/en-US/docs/SVG"
target="_blank">
<rect height="30" width="120" y="0" x="0" rx="15"/>
<text fill="white" text-anchor="middle"
y="21" x="60">SVG on MDN</text>
</a>
</svg>
Rezultat
{{EmbedLiveSample("Example", 170, 60)}}
Specyfikacja