HTML5 <base> Tag


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

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

<a href="default.php">W3Tutors' CSS Tutorial</a>

Try it yourself »

Definition and Usage

The <base> tag specifies a default URL, and/or a default target, for all elements with a URL (hyperlinks, images, forms, etc.).

The <base> tag must be inside the head element.

Differences Between HTML 4.01 and HTML5


Tips and Notes

Tip: Put the <base> tag as the first element in the head element, so that other elements in the head section uses the information from the <base> element.

Note: Maximum one <base> element in a document.

Note: If the <base> tag is present, it must have either an href attribute, a target attribute, or both.


Attribute Value Description
href URL Specifies the URL to use as the base URL for links in the page
target _blank
Specifies where to open all the links on the page.
This attribute can be overridden by using the target attribute in each link

Standard Attributes and Events