Web Development HTML Guide - Learn HTML
Developer Tutorials
ASP
CGI & Perl
CSS
Flash
HTML
Java
JavaScript
Linux
MySQL
PHP
Photoshop
Python
Wireless
XML



Developer Manuals
Learn HTML
Learn PHP
Learn MySQL
Learn CSS
Learn Pear


Developer Scripts
ASP Scripts
ASP.NET Scripts
CGI & Perl Scripts
Flash Scripts
Java Scripts
JavaScript Scripts
PHP Scripts
Python Scripts
Remotely Hosted Scripts
Tools & Utilities Scripts
XML Scripts

Developer Resources
Developer Tools
Developer News
Developer Forums
Developer Content
Developer Book Reviews
Survey Software

Web Hosting Directory
Budget Web Hosting
ColdFusion Hosting
Dedicated Servers
Domain Hosting
E-Commerce Hosting
Email Hosting
Free Web Hosting
Linux Web Hosting
Managed Hosting
Reseller Hosting
Small Business Hosting
Windows Web Hosting

<BASE ...>

Usage Recommendation
thumbs up use it

  • HREF: default address for hypertext links
 
  • TARGET: default window for linked documents

<BASE ...> tells the browser to pretend that the current page is located at some URL other than where the browser found it. Any relative reference will be calculated from the URL given by <BASE HREF="..."> instead of the actual URL. <BASE ...> goes in the <HEAD> section.

For example, consider a page whose URL is http://www.idocs.com/tags/linking/baseexample.html, and the full code of the page is this:

this code produces this
<HTML>
<HEAD>
<TITLE>Example of the BASE Tag</TITLE>
<BASE HREF="http://www.magenta.com/hello.html">
</HEAD>
<BODY>

<A HREF="index.html">go home</A>

</BODY>
</HTML>
this page

The <BASE ...> tag on this page tells the browser to pretend that the page is located at http://www.magenta.com/hello.html. The link on the page makes a relative reference to "index.html". Instead of calculating the full URL of the link as http://www.idocs.com/tags/linking/index.html, the link is calculated as http://www.magenta.com/index.html.

Generally it's best to avoid using <BASE ...>. It usually just restricts the ability to move a set of web pages from one location to another (say, from your computer where you are developing them to the server where they publicly reside). However, <BASE ...> can come in handy in development situations where the final version of the page will make relative references to resources that aren't on the development machine.


Copyright Idocs, Inc. Written by Miko Sullivan











About the NetVisits, Inc Network | Advertise
Developer Tutorials hosted by HostGator.
Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy.
Visit other NetVisits, Inc. sites: