base

FilterElements

HTML: <base>
XHTML: <base/>  or  <base />

Specifies the base pathname for all relative URLs in the document. Place this element within the head of the document.

Start/End Tags

This is an empty element. In HTML, the end tag is forbidden. In XHTML, the element must be closed with a trailing slash as just shown. Developers may include a space character before the slash for backward compatibility with older browsers.

Specifications

  • HTML 4.01
  • HTML5

href=

Values: URI
Required in HTML 4.01. Specifies the absolute URI that acts as the base URI for resolving relative URIs.

id=

Values: text
XHTML and HTML5 only. Assigns a unique identifying name to the element.

target=

Values: name
Defines the default target window for all links in the document.
HTML
<head>
  <title>Sample document</title>
  <base href="http://www.example.com/">
</head>
XHTML
<head>
  <title>Sample document</title>
  <base href="http://www.example.com/" />
</head>

Rendered Example

base is a non-rendering element.