HTML and CSS Reference
In-Depth Information
For example, the <base> tag in this XHTML document head:
<head>
<base href="http://www.kumquat.com/" />
</head>
...
tells the browser that any relative URLs within this document are relative
to the top-level document directory on www.kumquat.com , regardless
of the address and directory of the machine from which the user re-
trieved the current document.
Contrary to what you may expect, you can make the base URL relative,
not absolute. The browser should (but doesn't always) form an absolute
base URL out of this relative URL by filling in the missing pieces with the
URL of the document itself. This property can be used to good advant-
age. For instance, in this next HTML example:
<head>
<base href="/info/">
</head>
...
the browser makes the <base> URL into one relative to the server's /info
directory, which probably is not the same directory of the current docu-
ment. Imagine if you had to readdress every link in your document with
that common directory. Not only does the <base> tag help you shorten
those URLs in your document that have a common root, but it also lets
you constrain the directory from which relative references are retrieved
without binding the document to a specific server.
 
Search WWH ::




Custom Search