You are here: Reference > HTML > attributes > href (base)

href attribute (base)

Browser support:
Sets the base URL to be used throughout the document for relative URL addresses.
By default, the base URL is the location of the current document, but it can be overridden by this attribute.
JavaScript page for this attribute: href. You can find other example(s) there.

Possible values:

String that sets the URL to use as a base URL.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the href attribute:
<head>
    <base href="http://help.dottoro.com/external/examples/" />
</head>
<body>
    This link is relative to the <a href="common/images/area.gif">base URL</a>.
</body>
Did you find this example helpful? yes no

Supported by tags:

External links:

User Contributed Comments

Post Content

Post Content