We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

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

CategoriesContainer element
Permitted contentAny number of the following elements, in any order:
Animation elements
Descriptive elements
Shape elements
Structural elements
Gradient elements
<a>, <altGlyphDef>, <clipPath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignObject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view>

Atrybuty

Atrybuty globalne

Atrybuty specyficzne

No browser supports all XLink attributes.

DOM model

Element implementuje 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

Specyfikacja

Specification Status Comment
Scalable Vector Graphics (SVG) 2
The definition of '<a>' in that specification.
Candidate Recommendation Replaced xlink:href attribute by href
Scalable Vector Graphics (SVG) 1.1 (Second Edition)
The definition of '<a>' in that specification.
Recommendation Initial definition

Wsparcie przeglądarek

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) IE Opera Safari
Basic support 1.0 (Yes) 1.5 (1.8) 9.0 9.0 3.0.4
Feature Android Edge Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 3.0 (Yes) 1.0 (1.8) No support (Yes) 3.0.4

Autorzy i etykiety dokumentu

Etykiety: 
Autorzy tej strony: devMike
Ostatnia aktualizacja: devMike,