Base URL

Base specifies the base pathname for all relative URLs in the body of the web page. A base specification bears the form

<base href="http://www.explainth.at/en/html" />

Note that it is necessary to specify the full path here - starting with http/s as appropriate. The terminating solidus, /, is only needed for XHTML. One can optionally specify a target="name" attribute to cause the link to be opened in a named window. The name can either be that for a named HTML frame or one of the following intrinsic target names

Although we have talked of frames and framesets on this page we hasten to add that frames are wholly incompatible with good webpage design. Therefore, there is no further discussion of frames on this site. All the effects delivered by a frame can be accomplished by using positioned div elements.

By specifying a default target in the base path declaration and overriding it as required by specifying the target attribute in individual anchor tags one can create more compact web pages which are easier to maintain.

Some of the more obscure browsers and many "download accelerators" have difficulty correctly interpreting complex paths specified relative to a base URL. Consequently you will find some spurious "file not found" errors in your log files. While this could be easily corrected using a few SSI directives to deliver a different version of the document if the browser is not one of IE, Firefox, Opera or Safari, our experience suggests that the extra effort and complexity are rarely warranted.

Jump To...

Colophon