<base href="">

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O
Type

The BASE element specifies the base URL for relative links.

This element is placed inside the HEAD element.


<base href="http://www.example.com/">

Attribute Value Explanation
href=" " URL the base location (absolute URL)

The target attribute can be used with the BASE element.

<base href="http://www.example.com/" target="_blank">

Example


<html>
<head>
<title>TAG index</title>
<base href="https://www.tagindex.net/html/">
</head>
<body>

<ul>
<li><a href="../index.html">Top page</a> (https://www.tagindex.net/index.html)</li>
<li><a href="index.html">HTML Tags</a> (https://www.tagindex.net/html/index.html)</li>
<li><a href="link/base.html">Base tag</a> (https://www.tagindex.net/html/link/base.html)</li>
</ul>

</body>
</html>

Output
Example pagenew window