From (Copyright Refsnes Data)

HTML <base> tag


Specify a default URL and a default target for all links on a page:

<base href="" />
<base target="_blank" />

<img src="stickman.gif" />
<a href="">W3Schools</a>

Try it yourself!

Definition and Usage

The <base> tag specifies a default address for links or a default target for linked documents.

The <base> tag goes inside the head element.

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The <base> tag is supported in all major browsers.

Differences Between HTML and XHTML

In HTML the <base> tag has no end tag.

In XHTML the <base> tag must be properly closed.


DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.

Attribute Value Description DTD
href URL Specifies the URL to use as the base URL for links in the page STF
target _blank
Where to open all the links on the page. This attribute can be overridden by using the target attribute in each link.
  • _blank - all the links will open in new windows
  • _self - all the links will open in the same frame they where clicked on
  • _parent - all the links will open in the parent frameset
  • _top - all the links will open in the full body of the window
  • framename - the name of the target frame

Standard Attributes and Events


From (Copyright Refsnes Data)