HTML <base> tag

Usage

Defines the base URL for all links within a web page. Must be placed within the <head> element.

Example

Code:

Example:

Normal link:

<a href="http://www.beginnersguidetohtml.com/guides.htm">Guides</a>

Link using <base>:

<head>
<base href="http://www.beginnersguidetohtml.com/" />
</head>
<body>
<a href="guides.htm">Guides</a>

Required Attributes

  • href - the base URL to be used

Optional Attributes

  • none

Core Attributes