HTML base href Attribute

Definition and Usage

The href attribute specifies the base (default base location) URL for a page.


<base href="URL">

Syntax Example

<base href="" />

Attribute Values

Value Description
URL The web resource/address to use as a base URL for the page.Possible URL values:
  • An absolute URL - An URL with full address is required (like href="")

Browser Support

The attribute is supported in all major browsers.

Tips and Notes

Note: The base element must be in the <head> element.
Note: The base element does not work as intended when using anchor URLs (like href="#bottom"). It will then reload the page.
Tip: All URLs should be URL encoded when required.


<base href="" />
<p><a href="default.asp"></a></p>
HTML base href Attribute Reviewed by 1000sourcecodes on 09:06 Rating: 5
Powered by Blogger.