Search notes:

HTML element: base

The <base> uses one or both of the following attributes for the noted purpose:
Attribute Purpose Misc
href Specify the document's base URL, used when parsing URLs (for example in <a href="…" … or <img src="…">). The value can be accessed in JavaScript with Node.baseURI.
target The default navigable, used for following hyperlinks
There can (should) be at most one <base> element in a document.
Open Graph tags are not influenced by the <base> element; they should always have a full URL.

Simple snippet

In the following example, the first link points to https://server.xyz/path/to/root/dir/sub/abc.html and the second one to https://server.xyz/top/abc.html.
This is because the first link does not start with a slash, but the second one does.
<base href="https://server.xyz/path/to/root/dir/">

<a href="sub/abc.html">relative link</a>

<a href="/top/abc.html">absolute link</a>

See also

HTML elements

Index