HTML base

From Htmlpedia
Jump to: navigation, search

HTML Element Base

Definition and usage

The <base> element defines the base URL of a document and/or the default target attribute (in a transitional doctype). "Base URL" refers to whatever would precede a relative URL. It may only be used within the <head> section of a document.


<base href="">


A relative hyperlink such as:

<a href="products/htmlpedia.htm">HTMLPedia product information</a>

Would link to, as what precedes it was defined in the <base> tag.


Defines what will precede any relative hyper-text references, be they hyper-links (<a href="">, or images (<img src="" />).
Only available in transitional doctypes. Defines the default target attribute for hyper-links, but can be over-ridden on a per-hyperlink basis.