You can write the internet wide and unique URI inside an HTML file loaded onto an internet server. A web browser that processes this information can then better access referenced or linked files. The base defined here functions as a suitable model for links to other HTML files or references to graphics and multimedia.
An Example:
<head>
<base href= “http://www.html.co.uk/”>
</head>
Explanation:
The file base element consists of <base href= …> and the exact file URI.
If graphics such as the following exist in the file:
<img src= “/src/logo.gif”>
The web browser then determines an absolute URI for this graphic:
<img src= “http://www.html.co.uk/src/logo.gif”>.
Take Note:
If it is important for you that your project remains easily transferable to other server computers in different directory structures, then you should refrain from defining an address base. Because with an element linking to a unique internet address, the web browser will continually attempt to load graphics and link destinations for the entered address. This makes testing a file on your local PC impossible!
On the other hand, the address base element provides a certain level of protection for the HTML illiterate who wish to save a HTML file locally or search the cache directory of their web browser. While locally accessing a HTML file, the web browser will always demand an online connection and then load the file from the address entered.
If you work in XHTML standard conform, then you must describe the base element as content less. Use the standalone tag in this form to do so: <base … />.
Window Destination Base
This element is useful in conjunction with frames, for example. It can determine for an HTML file, that is shown inside a frameset in a frame window, that all of the links within the file should be shown in a different frame window, as long as the link does not demand any other type of frame window. Because many link destinations in a file, which is shown in a frame window, actually should be displayed in a different window type, this one time element in the file header saves a lot of typing work and makes the file more manageable.
An Example:
<head>
<base target= “RightWindow”>
</head>
Explanation:
With <base target= … > you determine the default window in which the link destination should be displayed. The requirement for the above example is that the frameset is defined with window frames. You must determine the desired frame window by entering the window name with the name attribute in <base target= … >.
Instead of assigning a window name on your own, you can also use the following predetermined elements which are also useful for more than just framesets.
<base target= “_blank”> opens every link within the file in a different browser window.
<base target= “_top”> opens every link inside the file in the entire browser window and prevents all other framesets from being displayed.
<base target= “_parent”> opens every link inside the file in a upper level frameset and prevents the display of inner framesets. _parent and _top distinguish between each other when a window again contains a complete frameset.