HTML <base> Tag
Definition and Usage
The <base>
tag sets the main web address and/or destination for all shorter web addresses in a document.
The <base>
tag needs to include either an "href" or a "target" attribute, or it can have both.
In a document, you can have only one <base>
element. This element should be placed within the section.
Attributes
Attribute | Value | Description |
---|---|---|
href | URL | This sets the main website address that all partial website addresses on the page are related to. |
target | _blank _parent _self _top |
Sets the standard destination for all links and forms on the webpage. |
Global Attributes and Events
The <base>
tag in HTML can also use the Global Attributes.
Event Attributes
The <base>
tag cannot be used for event attributes.