English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML-Referenzhandbuch

HTML-Tag-Verzeichnis

HTML: <a> href-Attribute

Dieser Artikel beschreibt die Verwendung des <a> href-Attributes, zeigt Beispiele zur Verwendung des <a> href-Attributes, die Kompatibilität des Browsers, die Syntaxdefinition und detaillierte Informationen zu seinen Attributwerten.

HTML <a> Tag

Online-Beispiel

Der href-Attribute legt die Zieladresse des Links fest:

<p>Absoluter Pfad URL: <a href="//de.oldtoolbag.com/">Grundlegende Anleitungswelt</a></p>
<p>Relativer Pfad URL: <a href="/Tags/Tag-a.html">a 标签</a></p>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the href attribute.

Definition and Usage

The href attribute specifies the URL of the page to which the link goes.


If the href attribute does not exist, the <a> tag is not a hyperlink.

HTML 4.01 With HTML5 Difference

In HTML5 In, if the <a> tag does not have an href attribute, it will be A placeholder hyperlink.

Syntax

<a href="URL">

Attribute value

ValueDescription
URLThe URL of a hyperlink. Possible values:
  • Absolute URL - Point to another site (for example href="http://www.example.com/"index.htm"

  • Relative URL - Point to a file within the site (href="index.htm")

  • Anchor URL - Point to an anchor in the page (href="#top")

More examples

Using an anchor URL
How to link to an element with a specified ID in a page (HTML5The name attribute is not supported).

HTML <a> Tag