HTML <base> href - Attribut

❮ HTML <base>-Tag

Beispiel

Geben Sie eine Basis-URL für alle relativen URLs auf einer Seite an:

<head>
  <base href="https://www.w3schools.com/images/">
</head>

Definition und Verwendung

Das hrefAttribut gibt die Basis-URL für alle relativen URLs auf einer Seite an.


Browser-Unterstützung

Attribute
href Yes Yes Yes Yes Yes

Syntax

<base href="URL">

Attributwerte

Value Description
URL An absolute URL that acts as the base URL (like "http://www.example.com/")

❮ HTML <base>-Tag