HTML Infos : base

Description

The base element allows authors to specify the document base URL for the purposes of resolving relative URLs, and the name of the default browsing context for the purposes of following hyperlinks. The element does not represent any content beyond this information. In HTML 5, the base element must be in the head element

Doctypes

Attributes

NameValueDescription
Attribute's nameAttribute's valueAttribute's description
hrefurlDefines the document base URL
target_blank | _self | _parent | _top | string valueDefines the browsing context name

Examples

HTML 4.01

<base href="http://my.hostname.com/path/"/>
<p><a href="page.html">My page</a></p>

HTML 5.0

<!DOCTYPE html>
<html>
    <head>
        <base href="http://my.hostname.com/path/"/>
    </head>
    <body>
        <p><a href="page.html">My page</a></p>
    </body>
</html>
English | Français