mozilla

Revision 430097 of <a>

  • Raccourci de la révision : Web/HTML/Element/a
  • Titre de la révision : <a>
  • ID de la révision : 430097
  • Créé :
  • Créateur : tregagnon
  • Version actuelle ? Non
  • Commentaire

Contenu de la révision

Résumé

L'élément HTML <a> (pour anchor) définit un hyperlien, une cible de destination nommée pour un hyperlien, ou les deux à la fois.

Attributs

Comme tous les autres éléments HTML, cet élément accepte les attributs globaux.

{{ htmlattrdef("charset") }} {{ obsoleteGeneric("inline","HTML5") }}
Cet attribut défini le jeu de caractères de la ressource liée. La valeur est une liste de jeux de caractères (défini dans RFC 2045) séparés par des espaces ou des virgules. La valeur par défaut est ISO-8859-1.

Note d'utilisation : Cet attribut est obsolète en HTML5, et ne doit plus être utilisé par les auteurs. Pour obtenir le même effet, utilisez l'entête HTTP Content-Type sur la ressource liée.

{{ htmlattrdef("coords") }} {{ HTMLVersionInline(4) }} seulement, {{ obsoleteGeneric("inline","HTML5") }}
Pour utiliser avec des objets formes. Cet attribut utilise une liste de nombres séparés par des virgules, définissant les coordonnées de l'objet sur la page.
{{ htmlattrdef("datafld") }} {{ Non-standard_inline() }}
This attribute specifies the column name from that data source object that supplies the bound data.

Note d'utilisation : This attribute is non-standard and should not be used by authors. To achieve its effect, use scripting and a mechanism such as XMLHttpRequest to populate the page dynamically

Support Gecko Presto WebKit Trident
Non implémenté Non implémenté Non implémenté IE4, IE5, IE6, IE7 (Retiré dans IE8)
Document normatif Microsoft's Data Binding: dataFld Property (MSDN)
{{ htmlattrdef("datasrc") }} {{ Non-standard_inline() }}
This attribute indicates the ID of the data source object that supplies the data that is bound to this element.

Note d'utilisation : This attribute is non-standard and should not be used by authors. To achieve its effect, use scripting and a mechanism such as XMLHttpRequest to populate the page dynamically.

Support Gecko Presto WebKit Trident
Non implémenté Non implémenté Non implémenté IE4, IE5, IE6, IE7 (Retiré dans IE8)
Document normatif Microsoft's Data Binding: dataSrc Property (MSDN)
{{ htmlattrdef("download") }} {{ HTMLVersionInline(5) }}
This attribute, if present, indicates that the author intends the hyperlink to be used for downloading a resource. If the attribute has a value, the browser should interpret that as the default filename that the author recommends for use in labeling the resource in a local file system. There are no restrictions on allowed values, but you should consider that most file systems have limitations with regard to what punctuation is supported in file names, and browsers are likely to adjust file names accordingly.

Note : You can use this with data:, blob: and filesystem: URLs, to make it easy for users to download programmatically generated content.

{{ htmlattrdef("href") }}
This is the single required attribute for anchors defining a hypertext source link. It indicates the link target, either a URL or a URL fragment. A URL fragment is a name preceded by a hash mark (#), which specifies an internal target location (an ID) within the current document. URLs are not restricted to Web (HTTP)-based documents. URLs might use any protocol supported by the browser. For example, file, ftp, and mailto work in most user agents.

Note : You can use the special fragment "top" to create a link back to the top of the page; for example <a href="#top">Return to top</a>. This behavior is specified by HTML5.

{{ htmlattrdef("hreflang") }}
This attribute indicates the language of the linked resource. It is purely advisory. Allowed values are determined by BCP47 for HTML5 and by RFC1766 for HTML4. Use this attribute only if the {{ htmlattrxref("href", "a") }} attribute is present.
{{ htmlattrdef("media") }} {{ HTMLVersionInline(5) }}
This attribute specifies the media which the linked resource applies to. Its value must be a media query. This attribute is mainly useful when linking to external stylesheets by allowing the user agent to pick the best adapted one for the device it runs on.

Note d'utilisation :

  • In HTML 4, only simple white-space-separated list of media description literals, i.e. media types and groups, where defined and allowed as values for this attribute, like print, screen, aural, braille, ... HTML 5 extended this to any kind of media queries, which are a superset of the allowed values of HTML 4.
  • Browsers not supporting the CSS3 Media Queries won't necessarilly recognize the adequate link; do not forget to set fallback links, the restricted set of media queries defined in HTML 4.
{{ htmlattrdef("methods") }} {{ Non-standard_inline() }}
The value of this attribute provides information about the functions that might be performed on an object. The values generally are given by the HTTP protocol when it is used, but it might (for similar reasons as for the title attribute) be useful to include advisory information in advance in the link. For example, the browser might choose a different rendering of a link as a function of the methods specified; something that is searchable might get a different icon, or an outside link might render with an indication of leaving the current site. This attribute is not well understood nor supported, even by the defining browser, Internet Explorer 4. Methods Property (MSDN)
{{ htmlattrdef("name") }} {{ HTMLVersionInline(4) }} seulement, {{ obsoleteGeneric("inline","HTML5") }}
This attribute is required in an anchor defining a target location within a page. A value for name is similar to a value for the id core attribute and should be an alphanumeric identifier unique to the document. Under the HTML 4.01 specification, id and name both can be used with the <a> element as long as they have identical values.

Note d'utilisation : This attribute is obsolete in HTML5, use global attribute id instead.

{{ htmlattrdef("ping") }} {{ HTMLVersionInline(5) }}
Le support de ping a été désactivé à partir de Firefox 3 beta 3.{{ Bug(415168) }}
{{ htmlattrdef("rel") }}
For anchors containing the href attribute, this attribute specifies the relationship of the target object to the link object. The value is a space-separated list of relationship values. The values and their semantics will be registered by some authority that might have meaning to the document author. The default relationship, if no other is given, is void. Use this attribute only if the href attribute is present.
{{ htmlattrdef("rev") }} {{ HTMLVersionInline(4) }} seulement, {{ obsoleteGeneric("inline","HTML5") }}
This attribute specifies a reverse link, the inverse relationship of the rel attribute. It is useful for indicating where an object came from, such as the author of a document.
Note : It is advisable to use the usemap attribute for the {{ HTMLElement("img") }} element and the associated {{ HTMLElement("map") }} element to define hotspots instead of the shape attribute.
{{ htmlattrdef("shape") }} {{ HTMLVersionInline(4) }} seulement, {{ obsoleteGeneric("inline","HTML5") }}
This attribute is used to define a selectable region for hypertext source links associated with a figure to create an image map. The values for the attribute are circle, default, polygon, and rect. The format of the coords attribute depends on the value of shape. For circle, the value is x,y,r where x and y are the pixel coordinates for the center of the circle and r is the radius value in pixels. For rect, the coords attribute should be x,y,w,h. The x,y values define the upper-left-hand corner of the rectangle, while w and h define the width and height respectively. A value of polygon for shape requires x1,y1,x2,y2,... values for coords. Each of the x,y pairs defines a point in the polygon, with successive points being joined by straight lines and the last point joined to the first. The value default for shape requires that the entire enclosed area, typically an image, be used.
{{ htmlattrdef("target") }}
This attribute specifies where to display the linked resource. In HTML4, this is the name of, or a keyword for, a frame. In HTML5, it is a name of, or keyword for, a browsing context (for example, tab, window, or inline frame). The following keywords have special meanings:
  • _self: Load the response into the same HTML4 frame (or HTML5 browsing context) as the current one. This value is the default if the attribute is not specified.
  • _blank: Load the response into a new unnamed HTML4 window or HTML5 browsing context.
  • _parent: Load the response into the HTML4 frameset parent of the current frame or HTML5 parent browsing context of the current one. If there is no parent, this option behaves the same way as _self.
  • _top: In HTML4: Load the response into the full, original window, canceling all other frames. In HTML5: Load the response into the top-level browsing context (that is, the browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this option behaves the same way as _self.
Use this attribute only if the href attribute is present.
{{ htmlattrdef("type") }}
This attribute specifies the media type in the form of a MIME type for the link target. Generally, this is provided strictly as advisory information; however, in the future a browser might add a small icon for multimedia types. For example, a browser might add a small speaker icon when type is set to audio/wav. For a complete list of recognized MIME types, see http://www.w3.org/TR/html4/references.html#ref-MIMETYPES. Use this attribute only if the href attribute is present.
{{ htmlattrdef("urn") }} {{ Non-standard_inline() }}
This supposedly Microsoft-supported attribute relates a uniform resource name (URN) with the link. While it is based on standards work years back, the meaning of URNs is still not well defined, so this attribute is meaningless. urn Property (MSDN)

Interface DOM

This element implements the HTMLAnchorElement interface.

Exemple

<!-- Hyperlien vers une ressource externe -->
<a href="http://www.mozilla.com/">
Hyperlien
</a>

Résultat

Hyperlien

Spécifications

Spécification Statut Commentaires
{{SpecName('HTML WHATWG', 'text-level-semantics.html#the-a-element', '<a>')}} {{Spec2('HTML WHATWG')}}  
{{SpecName('HTML5 W3C', 'the-a-element.html#the-a-element', '<a>')}} {{Spec2('HTML5 W3C')}}  
{{SpecName('HTML4.01', 'struct/links.html#h-12.2', '<a>')}} {{Spec2('HTML4.01')}}  

Compatibilité des navigateurs

{{CompatibilityTable}}

Fonctionnalité Chrome Firefox (Gecko) Internet Explorer Opera Safari
Support basique {{CompatVersionUnknown}} {{CompatGeckoDesktop("1.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
href="#top" {{CompatVersionUnknown}} {{CompatGeckoDesktop("10.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
{{htmlattrxref("download","a")}} 14 {{CompatGeckoDesktop("20.0")}} {{CompatNo}} {{CompatNo}} {{CompatUnknown}}
Fonctionnalité Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Support basique {{CompatVersionUnknown}} {{CompatGeckoMobile("1.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
href="#top" {{CompatVersionUnknown}} {{CompatGeckoMobile("10.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
{{htmlattrxref("download","a")}} {{CompatVersionUnknown}} {{CompatGeckoMobile("20.0")}} {{CompatNo}} {{CompatUnknown}} {{CompatUnknown}}

Notes

Les raccourcis clavier suivant sont réservés par deux des principaux navigateurs, et ne doivent pas être utilisé comme valeur pour accesskey : a, c, e, f, g, h, v, flêche droite et flêche gauche.

HTML 3.2 définit seulement name, href, rel, rev, et title.

L'attribut target n'est pas défini dans les navigateurs qui ne supportent pas les frames, tel que les navigateurs de la génération Netscape 1. De plus, target n'est pas autorisé dans les variantes stricts de XHTML, mais limité à frameset et transitional.

Recommandations JavaScript

Les éléments <a> sont souvent utilisés avec l'évènement onclick. Pour éviter à la page d'être rafraîchie, href est souvent défini soit à "#" ou "javascript:void(0)". Ces deux valeurs peuvent amener des erreurs inattendues quand les liens sont copiés, ou ouvert dans une nouvelle fenêtre ou onglet. Faîtes y attention pour des questions d'utilisabilité, quand vous utilisez des <a> et que vous désactivez son comportement par défaut.

Voir également

Autres éléments de sémantique au niveau texte : {{HTMLElement("abbr")}}, {{HTMLElement("em")}}, {{HTMLElement("strong")}}, {{HTMLElement("small")}}, {{HTMLElement("cite")}}, {{HTMLElement("q")}}, {{HTMLElement("dfn")}}, {{HTMLElement("time")}}, {{HTMLElement("code")}}, {{HTMLElement("var")}}, {{HTMLElement("samp")}}, {{HTMLElement("kbd")}}, {{HTMLElement("sub")}}, {{HTMLElement("sup")}}, {{HTMLElement("b")}}, {{HTMLElement("i")}}, {{HTMLElement("mark")}}, {{HTMLElement("ruby")}}, {{HTMLElement("rp")}}, {{HTMLElement("rt")}}, {{HTMLElement("bdo")}}, {{HTMLElement("span")}}, {{HTMLElement("br")}}, {{HTMLElement("wbr")}}.

{{ HTML:Element_Navigation() }}

Source de la révision

<h2 id="R.C3.A9sum.C3.A9">Résumé</h2>
<p>L'<strong>élément HTML <code>&lt;a&gt;</code></strong> (pour <em>anchor</em>) définit un hyperlien, une cible de destination nommée pour un hyperlien, ou les deux à la fois.</p>
<ul class="htmlelt">
  <li><dfn><a href="/fr/docs/Web/HTML/Catégorie_de_contenu" title="/fr/docs/HTML/Catégorie_de_contenu">Catégories de contenu&nbsp;</a></dfn><a href="/fr/docs/Web/HTML/Catégorie_de_contenu#Contenu_de_flux" title="/fr/docs/HTML/Catégorie_de_contenu#Contenu_de_flux">Contenu de flux</a>, <a href="/fr/docs/Web/HTML/Cat%C3%A9gorie_de_contenu#Contenu_phras.C3.A9" title="/fr/docs/HTML/Cat%C3%A9gorie_de_contenu#Contenu_phras.C3.A9">contenu phrasé</a>, <a href="/fr/docs/Web/HTML/Catégorie_de_contenu#Contenu_interactif" title="/fr/docs/Web/HTML/Catégorie_de_contenu#Contenu_interactif">contenu interactif</a>, contenu palpable.</li>
  <li><dfn>Contenu autorisé </dfn><a href="/fr/docs/Web/HTML/Catégorie_de_contenu#Mod.C3.A8le_de_contenu_transparent" title="/fr/docs/Web/HTML/Catégorie_de_contenu#Mod.C3.A8le_de_contenu_transparent">Transparent</a>, contenant soit des <a href="/fr/docs/Web/HTML/Catégorie_de_contenu#Contenu_de_flux" title="/fr/docs/HTML/Catégorie_de_contenu#Contenu_de_flux">contenus de flux</a> ou des <a href="/fr/docs/Web/HTML/Cat%C3%A9gorie_de_contenu#Contenu_phras.C3.A9" title="/fr/docs/HTML/Cat%C3%A9gorie_de_contenu#Contenu_phras.C3.A9">contenus phrasé</a>,</li>
  <li><dfn>Omission de balises </dfn> {{no_tag_omission}}</li>
  <li><dfn>Élément parents autorisés </dfn>Tout élément acceptant du <a href="/fr/docs/Web/HTML/Cat%C3%A9gorie_de_contenu#Contenu_phras.C3.A9" title="/fr/docs/HTML/Cat%C3%A9gorie_de_contenu#Contenu_phras.C3.A9">contenu phrasé</a>, ou tout élément acceptant du <a href="/fr/docs/Web/HTML/Catégorie_de_contenu#Contenu_de_flux" title="/fr/docs/HTML/Catégorie_de_contenu#Contenu_de_flux">contenu de flux</a>.</li>
  <li><dfn>Interface DOM </dfn> {{domxref("HTMLAnchorElement")}}.</li>
</ul>
<h2 id="Attributs">Attributs</h2>
<p>Comme tous les autres éléments HTML, cet élément accepte les <a href="/fr/docs/Web/HTML/Global_attributes" title="/fr/docs/HTML/Global_attributes">attributs globaux</a>.</p>
<dl>
  <dt>
    {{ htmlattrdef("charset") }} {{ obsoleteGeneric("inline","HTML5") }}</dt>
  <dd>
    Cet attribut défini le jeu de caractères de la ressource liée. La valeur est une liste de jeux de caractères (défini dans <a class="external" href="http://tools.ietf.org/html/rfc2045" title="http://tools.ietf.org/html/rfc2045">RFC 2045</a>) séparés par des espaces ou des virgules. La valeur par défaut est ISO-8859-1.<br />
    <div class="note">
      <p><strong>Note d'utilisation : </strong>Cet attribut est obsolète en HTML5, et <strong>ne doit plus être utilisé</strong> par les auteurs. Pour obtenir le même effet, utilisez l'entête HTTP Content-Type sur la ressource liée.</p>
    </div>
  </dd>
  <dt>
    {{ htmlattrdef("coords") }} {{ HTMLVersionInline(4) }} seulement, {{ obsoleteGeneric("inline","HTML5") }}</dt>
  <dd>
    Pour utiliser avec des objets formes. Cet attribut utilise une liste de nombres séparés par des virgules, définissant les coordonnées de l'objet sur la page.</dd>
  <dt>
    {{ htmlattrdef("datafld") }} {{ Non-standard_inline() }}</dt>
  <dd>
    This attribute specifies the column name from that data source object that supplies the bound data.
    <div class="note">
      <p><strong>Note d'utilisation </strong><strong>: </strong>This attribute is non-standard and <strong>should not be used by authors</strong>. To achieve its effect, use scripting and a mechanism such as <a href="/en-US/docs/nsIXMLHttpRequest" title="en-US/docs/XMLHttpRequest">XMLHttpRequest</a> to populate the page dynamically</p>
    </div>
    <table class="fullwidth-table">
      <tbody>
        <tr>
          <td rowspan="2">Support</td>
          <td>Gecko</td>
          <td>Presto</td>
          <td>WebKit</td>
          <td>Trident</td>
        </tr>
        <tr>
          <td>Non implémenté</td>
          <td>Non implémenté</td>
          <td>Non implémenté</td>
          <td>IE4, IE5, IE6, IE7 (Retiré dans IE8)</td>
        </tr>
        <tr>
          <td>Document normatif</td>
          <td colspan="4"><a class="external" href="http://msdn.microsoft.com/en-us/library/ms533703%28VS.85%29.aspx">Microsoft's Data Binding: dataFld Property (MSDN)</a></td>
        </tr>
      </tbody>
    </table>
  </dd>
  <dt>
    {{ htmlattrdef("datasrc") }} {{ Non-standard_inline() }}</dt>
  <dd>
    This attribute indicates the ID of the data source object that supplies the data that is bound to this element.
    <div class="note">
      <p><strong>Note d'utilisation </strong><strong>: </strong>This attribute is non-standard and <strong>should not be used by authors</strong>. To achieve its effect, use scripting and a mechanism such as <a href="/en-US/docs/nsIXMLHttpRequest" title="en/XMLHttpRequest">XMLHttpRequest</a> to populate the page dynamically.</p>
    </div>
    <table class="fullwidth-table">
      <tbody>
        <tr>
          <td rowspan="2">Support</td>
          <td>Gecko</td>
          <td>Presto</td>
          <td>WebKit</td>
          <td>Trident</td>
        </tr>
        <tr>
          <td>Non implémenté</td>
          <td>Non implémenté</td>
          <td>Non implémenté</td>
          <td>IE4, IE5, IE6, IE7 (Retiré dans IE8)</td>
        </tr>
        <tr>
          <td>Document normatif</td>
          <td colspan="4"><a class="external" href="http://msdn.microsoft.com/en-us/library/ms533709(VS.85).aspx" title="http://msdn.microsoft.com/en-us/library/ms533709(VS.85).aspx">Microsoft's Data Binding: dataSrc Property (MSDN)</a></td>
        </tr>
      </tbody>
    </table>
  </dd>
  <dt>
    {{ htmlattrdef("download") }} {{ HTMLVersionInline(5) }}</dt>
  <dd>
    This attribute, if present, indicates that the author intends the hyperlink to be used for downloading a resource. If the attribute has a value, the browser should interpret that as the default filename that the author recommends for use in labeling the resource in a local file system. There are no restrictions on allowed values, but you should consider that most file systems have limitations with regard to what punctuation is supported in file names, and browsers are likely to adjust file names accordingly.
    <div class="note">
      <p><strong>Note :</strong> You can use this with <code>data:</code>, <code>blob:</code> and <code>filesystem:</code> URLs, to make it easy for users to download programmatically generated content.</p>
    </div>
  </dd>
  <dt>
    {{ htmlattrdef("href") }}</dt>
  <dd>
    This is the single required attribute for anchors defining a hypertext source link. It indicates the link target, either a URL or a URL fragment. A URL fragment is a name preceded by a hash mark (#), which specifies an internal target location (an <a href="/en-US/docs/HTML/Global_attributes#attr-id" title="Global attributes#attr-id">ID</a>) within the current document. URLs are not restricted to Web (HTTP)-based documents. URLs might use any protocol supported by the browser. For example, <code>file</code>, <code>ftp</code>, and <code>mailto</code> work in most user agents.
    <div class="note">
      <p><strong>Note :</strong> You can use the special fragment "top" to create a link back to the top of the page; for example <code>&lt;a href="#top"&gt;Return to top&lt;/a&gt;</code>. This behavior is specified by HTML5.</p>
    </div>
  </dd>
  <dt>
    {{ htmlattrdef("hreflang") }}</dt>
  <dd>
    This attribute indicates the language of the linked resource. It is purely advisory. Allowed values are determined by <a class="external" href="http://www.ietf.org/rfc/bcp/bcp47.txt" title="http://www.ietf.org/rfc/bcp/bcp47.txt">BCP47</a> for HTML5 and by <a class="external" href="http://www.ietf.org/rfc/rfc1766.txt" title="http://www.ietf.org/rfc/rfc1766.txt">RFC1766</a> for HTML4. Use this attribute only if the {{ htmlattrxref("href", "a") }} attribute is present.</dd>
  <dt>
    {{ htmlattrdef("media") }} {{ HTMLVersionInline(5) }}</dt>
  <dd>
    This attribute specifies the media which the linked resource applies to. Its value must be a <a href="/en-US/docs/CSS/Media_queries" title="en-US/docs/CSS/Media queries">media query</a>. This attribute is mainly useful when linking to external stylesheets by allowing the user agent to pick the best adapted one for the device it runs on.<br />
    <div class="note">
      <p><strong>Note d'utilisation </strong><strong>:</strong></p>
      <ul>
        <li>In HTML 4, only simple white-space-separated list of media description literals, i.e. <a href="/en-US/docs/CSS/@media" title="https://developer.mozilla.org/en-US/docs/CSS/@media">media types and groups</a>, where defined and allowed as values for this attribute, like <code>print</code>, <code>screen</code>, <code>aural</code>, <code>braille</code>, ... HTML 5 extended this to any kind of <a href="/en-US/docs/CSS/Media_queries" title="en-US/docs/CSS/Media queries">media queries</a>, which are a superset of the allowed values of HTML 4.</li>
        <li>Browsers not supporting the <a href="/en-US/docs/CSS/Media_queries" title="en-US/docs/CSS/Media queries">CSS3 Media Queries</a> won't necessarilly recognize the adequate link; do not forget to set fallback links, the restricted set of media queries defined in HTML 4.</li>
      </ul>
    </div>
  </dd>
  <dt>
    {{ htmlattrdef("methods") }} {{ Non-standard_inline() }}</dt>
  <dd>
    The value of this attribute provides information about the functions that might be performed on an object. The values generally are given by the HTTP protocol when it is used, but it might (for similar reasons as for the title attribute) be useful to include advisory information in advance in the link. For example, the browser might choose a different rendering of a link as a function of the methods specified; something that is searchable might get a different icon, or an outside link might render with an indication of leaving the current site. This attribute is not well understood nor supported, even by the defining browser, Internet Explorer 4. <a class="external" href="http://msdn.microsoft.com/en-us/library/ms534168(VS.85).aspx">Methods Property (MSDN)</a></dd>
  <dt>
    {{ htmlattrdef("name") }} {{ HTMLVersionInline(4) }} seulement, {{ obsoleteGeneric("inline","HTML5") }}</dt>
  <dd>
    This attribute is required in an anchor defining a target location within a page. A value for <strong>name</strong> is similar to a value for the <strong>id</strong> core attribute and should be an alphanumeric identifier unique to the document. Under the HTML 4.01 specification, <strong>id</strong> and <strong>name</strong> both can be used with the &lt;a&gt; element as long as they have identical values.
    <div class="note">
      <p><strong>Note d'utilisation </strong><strong>:</strong> This attribute is obsolete in HTML5, use <a href="/en-US/docs/HTML/Global_attributes#id" title="en-US/docs/HTML/Global attributes#id">global attribute <strong>id</strong></a> instead.</p>
    </div>
  </dd>
  <dt>
    {{ htmlattrdef("ping") }} {{ HTMLVersionInline(5) }}</dt>
  <dd>
    Le support de <code>ping</code> a été désactivé à partir de Firefox 3 beta 3.{{ Bug(415168) }}</dd>
  <dt>
    {{ htmlattrdef("rel") }}</dt>
  <dd>
    For anchors containing the <strong>href</strong> attribute, this attribute specifies the relationship of the target object to the link object. The value is a space-separated list of relationship values. The values and their semantics will be registered by some authority that might have meaning to the document author. The default relationship, if no other is given, is void. Use this attribute only if the <strong>href</strong> attribute is present.</dd>
  <dt>
    {{ htmlattrdef("rev") }} {{ HTMLVersionInline(4) }} seulement, {{ obsoleteGeneric("inline","HTML5") }}</dt>
  <dd>
    This attribute specifies a reverse link, the inverse relationship of the <strong>rel</strong> attribute. It is useful for indicating where an object came from, such as the author of a document.</dd>
</dl>
<div class="note">
  <strong>Note</strong> : It is advisable to use the <strong>usemap</strong> attribute for the {{ HTMLElement("img") }} element and the associated {{ HTMLElement("map") }} element to define hotspots instead of the <strong>shape</strong> attribute.</div>
<dl>
  <dt>
    {{ htmlattrdef("shape") }} {{ HTMLVersionInline(4) }} seulement, {{ obsoleteGeneric("inline","HTML5") }}</dt>
  <dd>
    This attribute is used to define a selectable region for hypertext source links associated with a figure to create an image map. The values for the attribute are <code>circle</code>, <code>default</code>, <code>polygon</code>, and <code>rect</code>. The format of the <strong>coords</strong> attribute depends on the value of shape. For <code>circle</code>, the value is <code>x,y,r</code> where <code>x</code> and <code>y</code> are the pixel coordinates for the center of the circle and <code>r</code> is the radius value in pixels. For <code>rect</code>, the <strong>coords</strong> attribute should be <code>x,y,w,h</code>. The <code>x,y</code> values define the upper-left-hand corner of the rectangle, while <code>w</code> and <code>h</code> define the width and height respectively. A value of <code>polygon</code> for <strong>shape</strong> requires <code>x1,y1,x2,y2,...</code> values for <strong>coords</strong>. Each of the <code>x,y</code> pairs defines a point in the polygon, with successive points being joined by straight lines and the last point joined to the first. The value <code>default</code> for shape requires that the entire enclosed area, typically an image, be used.</dd>
  <dt>
    {{ htmlattrdef("target") }}</dt>
  <dd>
    This attribute specifies where to display the linked resource. In HTML4, this is the name of, or a keyword for, a frame. In HTML5, it is a name of, or keyword for, a <em>browsing context</em> (for example, tab, window, or inline frame). The following keywords have special meanings:
    <ul>
      <li><code>_self</code>: Load the response into the same HTML4 frame (or HTML5 browsing context) as the current one. This value is the default if the attribute is not specified.</li>
      <li><code>_blank</code>: Load the response into a new unnamed HTML4 window or HTML5 browsing context.</li>
      <li><code>_parent</code>:&nbsp;Load the response into the HTML4 frameset parent of the current frame or HTML5 parent browsing context of the current one. If there is no parent, this option behaves the same way as <code>_self</code>.</li>
      <li><code>_top</code>: In HTML4: Load the response into the full, original window, canceling all other frames. In HTML5: Load the response into the top-level browsing context (that is, the browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this option behaves the same way as <code>_self</code>.</li>
    </ul>
    Use this attribute only if the <strong>href</strong> attribute is present.</dd>
  <dt>
    {{ htmlattrdef("type") }}</dt>
  <dd>
    This attribute specifies the media type in the form of a MIME type for the link target. Generally, this is provided strictly as advisory information; however, in the future a browser might add a small icon for multimedia types. For example, a browser might add a small speaker icon when type is set to audio/wav. For a complete list of recognized MIME types, see <a class="linkification-ext external" href="http://www.w3.org/TR/html4/references.html#ref-MIMETYPES" title="Linkification: http://www.w3.org/TR/html4/references.html#ref-MIMETYPES">http://www.w3.org/TR/html4/references.html#ref-MIMETYPES</a>. Use this attribute only if the <strong>href</strong> attribute is present.</dd>
  <dt>
    {{ htmlattrdef("urn") }} {{ Non-standard_inline() }}</dt>
  <dd>
    This supposedly Microsoft-supported attribute relates a uniform resource name (URN) with the link. While it is based on standards work years back, the meaning of URNs is still not well defined, so this attribute is meaningless. <a class="external" href="http://msdn.microsoft.com/en-us/library/ms534710(VS.85).aspx">urn Property (MSDN)</a></dd>
</dl>
<h2 id="Interface_DOM">Interface DOM</h2>
<p>This element implements the <code><a href="/en-US/docs/DOM/HTMLAnchorElement" title="en-US/docs/DOM/HTMLAnchorElement">HTMLAnchorElement</a></code> interface.</p>
<h2 id="Exemple">Exemple</h2>
<pre class="brush: xml">
&lt;!-- Hyperlien vers une ressource externe --&gt;
&lt;a href="<a class="linkification-ext" href="http://www.mozilla.com/" title="Linkification: http://www.mozilla.com/">http://www.mozilla.com/</a>"&gt;
Hyperlien
&lt;/a&gt;
</pre>
<h3 id="Result" name="Result">Résultat</h3>
<p><a class="external" href="http://www.mozilla.com/">Hyperlien</a></p>
<h2 id="Sp.C3.A9cifications">Spécifications</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Spécification</th>
      <th scope="col">Statut</th>
      <th scope="col">Commentaires</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{SpecName('HTML WHATWG', 'text-level-semantics.html#the-a-element', '&lt;a&gt;')}}</td>
      <td>{{Spec2('HTML WHATWG')}}</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>{{SpecName('HTML5 W3C', 'the-a-element.html#the-a-element', '&lt;a&gt;')}}</td>
      <td>{{Spec2('HTML5 W3C')}}</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>{{SpecName('HTML4.01', 'struct/links.html#h-12.2', '&lt;a&gt;')}}</td>
      <td>{{Spec2('HTML4.01')}}</td>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>
<h2 id="Compatibilit.C3.A9_des_navigateurs">Compatibilité des navigateurs</h2>
<p>{{CompatibilityTable}}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Fonctionnalité</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Support basique</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatGeckoDesktop("1.0")}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
      </tr>
      <tr>
        <td><code>href="#top"</code></td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatGeckoDesktop("10.0")}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
      </tr>
      <tr>
        <td>{{htmlattrxref("download","a")}}</td>
        <td>14</td>
        <td>{{CompatGeckoDesktop("20.0")}}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatUnknown}}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Fonctionnalité</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Support basique</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatGeckoMobile("1.0")}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
      </tr>
      <tr>
        <td><code>href="#top"</code></td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatGeckoMobile("10.0")}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
      </tr>
      <tr>
        <td>{{htmlattrxref("download","a")}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatGeckoMobile("20.0")}}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatUnknown}}</td>
        <td>{{CompatUnknown}}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="Notes">Notes</h2>
<p>Les raccourcis clavier suivant sont réservés par deux des principaux navigateurs, et ne doivent pas être utilisé comme valeur pour <code>accesskey</code> : a, c, e, f, g, h, v, flêche droite et flêche gauche.</p>
<p>HTML 3.2 définit seulement <code><strong>name</strong></code>, <code><strong>href</strong></code>, <code><strong>rel</strong></code>, <code><strong>rev</strong></code>, et <code><strong>title</strong></code>.</p>
<p>L'attribut <code><strong>target</strong></code> n'est pas défini dans les navigateurs qui ne supportent pas les frames, tel que les navigateurs de la génération Netscape 1. De plus, <code>target</code> n'est pas autorisé dans les variantes stricts de <a href="/fr/docs/XHTML" title="en-US/docs/XHTML">XHTML</a>, mais limité à frameset et transitional.</p>
<h3 id="Recommendations_JavaScript">Recommandations JavaScript</h3>
<p>Les éléments <code>&lt;a&gt;</code> sont souvent utilisés avec l'évènement <code>onclick</code>. Pour éviter à la page d'être rafraîchie, <strong><code>href</code></strong> est souvent défini soit à "#" ou "javascript:void(0)". Ces deux valeurs peuvent amener des erreurs inattendues quand les liens sont copiés, ou ouvert dans une nouvelle fenêtre ou onglet. Faîtes y attention pour des questions d'utilisabilité, quand vous utilisez des <code>&lt;a&gt;</code> et que vous désactivez son comportement par défaut.</p>
<h2>Voir également</h2>
<p>Autres éléments de sémantique au niveau texte : {{HTMLElement("abbr")}}, {{HTMLElement("em")}}, {{HTMLElement("strong")}}, {{HTMLElement("small")}}, {{HTMLElement("cite")}}, {{HTMLElement("q")}}, {{HTMLElement("dfn")}}, {{HTMLElement("time")}}, {{HTMLElement("code")}}, {{HTMLElement("var")}}, {{HTMLElement("samp")}}, {{HTMLElement("kbd")}}, {{HTMLElement("sub")}}, {{HTMLElement("sup")}}, {{HTMLElement("b")}}, {{HTMLElement("i")}}, {{HTMLElement("mark")}}, {{HTMLElement("ruby")}}, {{HTMLElement("rp")}}, {{HTMLElement("rt")}}, {{HTMLElement("bdo")}}, {{HTMLElement("span")}}, {{HTMLElement("br")}}, {{HTMLElement("wbr")}}.</p>
<p>{{ HTML:Element_Navigation() }}</p>
Revenir à cette révision