HTML base tag

HTML <base> Tag: The HTML base tag describes the base URL for all the relative URLs in a document. There must be only one base element and it should be inside the <head> element. And this tag belongs to the Metadata Content category. This URL will be the base URL for every link on the page and will be prefixed before each of them.

HTML <base> Tag

The <base> tag supports Global attributes but doesn’t support event attribute. The base tag must be defined between the head tags. And there can be a maximum of only 1 base tag in a page.

Syntax: <base href=” ” target=” “>

Browser compatibility

The <base> tag is supported by  different browsers.

  • Chrome
  • Firefox
  • Safari
  • InternetExplorer
  • Opera


<!DOCTYPE html>
  <base href="" target="_blank">
<p><img src="" width="250" height="250" alt="Freshersnow"> <br>Freshersnow Tutorials</p>


HTML base tag



Attributes supported by the <base> tag

Attribute Value Description
href URL Specifies the base URL for all relative URLs in the page
target _blank
frame name
Specifies the default target for all hyperlinks and forms in the page