W3 3.2y
4.0y
NS 3.0y
4.0y
IE 3.0y
4.0y
TV 1.2y
2.1y

<BASE>

Description

Supply a base address that must be used for resolving relative URI's to absolute URI's. When specified this address is used instead of the actual address and is used for images, style sheets etc. If there's no BASE element in the page, the document address is used.

Note: This is not necessarily the same as the URI used to request the document, as the base URI may be overridden by an HTTP header that redirects the browser to another address.

This is an example base element and the resulting address for an image:

<BASE href="http://www.acme.com/intro.html>";
...
<IMG src="icons/logo.gif">

The absolute address for the image is:

"http://www.acme.com/icons/logo.gif"

This element must be specified inside the HEAD section of the document, before any resource that is referenced with a relative address.

DTD

<!ELEMENT BASE - O EMPTY               -- document base URI -->
<!ATTLIST BASE
  href        %URI;          #REQUIRED -- URI that acts as base URI --
  >
from the HTML 4.0 DTD, "Copyright © W3C, (MIT, INRIA, Keio). All Rights Reserved."

Attributes

W3 3.2y
4.0y
NS 3.0y
4.0y
IE 3.0y
4.0y
TV 1.2y
2.1y
HREF
This attributes specifies the location of the document as an absolute URL. Then all subsequent URL's in this document are relative to this URL. This means links to images, other documents etc. will use this BASE address.
W3 3.2y
4.0y
NS 3.0y
4.0y
IE 3.0y
4.0y
TV 1.2y
2.1y
TARGET
This is used when you want all (or most) of the links in a document to be targeted to the same window or frame. In this case the TARGET attribute establishes a default window_name that all links in this document will be targeted to.
This default can be overridden by using the TARGET attribute in a link.

Magic TARGET names
These names all begin with the underscore character. Any targeted window name beginning with underscore which is not one of these names, will be ignored.

Value Description
_blank This target will cause the link to always be loaded in a new blank window. This window is not named.
_self This target causes the link to always load in the same window the anchor was clicked in. This is useful for overriding a globally assigned BASE target.
_parent This target makes the link load in the immediate FRAMESET parent of this document. This defaults to acting like _self if the document has no parent.
_top This target makes the link load in the full body of the window. This defaults to acting like _self if the document is already at the top. It is useful for breaking out of an arbitrarily deep FRAME nesting.

Examples

Source
To see the BASE element in action
<A href="BASE1.html">view this example</A>.
 
Result
To see the BASE element in action view this example.
Statistics