HTML base tag

HTML <base> tag specifies the alternate or default URL (address) for all the hyperlinks present in a page. This default URL is written in the href attribute of the <base> element.

 <base href="" target="_blank">
 <a href="">Go to web4college</a>

Tag omission

The base is self-closing element (</base>) i.e. there is no end tag.

Global Attributes

All global attributes are applicable on the base element.

Tag Attributes

Attributes that are applicable to <base> tag

This attribute contains the address or URL of the other pages.

<a href="address of external resource/URL">anchor text</a>

If there are more than one base elements then all the base elements are ignored except the first one.

If there are more than elements with different target attributes then all are ignored except first one.

Was this article helpful?