The <base> tag can be a time saver by re-defining the root folder of the page in which the tag is used. Let say that you are linking pages on a page in the root directory together but the files on the server are not in the root directory, they are a few folder deep like: root.com/stuff/otherstuff. So everytime you link something you’ll have to write: <a href=”stuff/otherstuff/yourfile.000>blabla</a>. So a shorter way of writing the whole thing is to simply move for that page the root folder to the level of that page. So you will include in the <head> of that page the new base directory. So when you write a link for that folder on the server you’ll simply be writing the folder and file that you set.
Ex:
| Source code | Browser |
| <html>
<head> <title>my page</title> <base href=”www.mydomain.com/stuff/otherstuff” /> </head> <body> <a href=”pageinotherstufffolder.htm”>page in that folder</a> |



Sun, Sep 28, 2008
HTML