An href on a <base> tag defines the base URL for all relative links on a page.
This value affects all relative URLs on the page.
A <base> element with an href attribute.
With this setting all relative links on the page start from https://en.wikipedia.org/wiki/.
<head>
<base href="https://en.wikipedia.org/wiki/">
</head>
<nav>
<a href="Vincent_van_Gogh">Vincent Van Gogh</a> <br />
<a href="Henri_Matisse">Henri Matisse</a> <br />
<a href="Paul_Cézanne">Paul Cézanne</a>
</nav>
The href attribute specifies the base URL for all relative URLs on a page.
This attibute affects URLs on <a>, <link>, <img>, <video>, <audio>, and other elements.
<base href="URL" />
Value | Description |
---|---|
URL | URL to be used as the prefix of all relative URLs in the page. |
Here is when href support started for each browser:
Chrome
|
1.0 | Sep 2008 |
Firefox
|
1.0 | Sep 2002 |
IE/Edge
|
1.0 | Aug 1995 |
Opera
|
1.0 | Jan 2006 |
Safari
|
1.0 | Jan 2003 |
Back to <base>