Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the "base" tag

Status
Not open for further replies.

Cheech

Technical User
Nov 6, 2000
2,933
EU
I am a trainee webmaster and my trainer has told me to use the "base" tag in all docs but I can not see why, as browsers default to current doc anyway. Any body know of an understandable reason for using it.
 
this the only meaning I could find why

The base element allows the URL of the document itself to be set, to help browsers in situations where the document may be read out of context. It is especially useful in allowing browsers to determine any partial URL's, or relative paths that may be specified (for example, in <A HREF> elements, or paths pointing to <IMG SRC=...> (images). The <base> Element should appear within the bounds of the <HEAD> element.
 
The base tag will also allow you to set the default target for all links.
 
About &quot;another content&quot; that noted Kruzer there is at least two situations:
1. you can read document off-line.
2. sometimes, when you do server-side rewrites (for example with apache mod_rewrite) you document seemly (for browser) belongs to another directory that you think it is. For example you can have following URLs to book's content:
two last entries are different and if you add
it comes worth. [sig]<p>Michael Dubner<br>Brainbench MVP/HTML+JavaScript<br>
[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top