HTML5 <base> Tag


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

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

<a href="../../index.html">QcTutorials Tutorial</a>
Code it Online »

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.

Tips and Notes

Hint: 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


Have Any Suggestion? We Are Waiting To Hear from YOU!

Your Query was successfully sent!