You are here:  NetStrider » Tutorials » HTMLRef » Commands » BASE «

HTML Reference Guide

Author: Randy D. Ralph.   In place March 1, 1999.   Copyright © 1999 NetStrider.   Presented as a public service.

BACK <BASE> Command next

Command Syntax:

<BASE command parameters>

The <BASE> command is used only within the <HEAD> command to establish default attributes for defined hypertext reference links within the page.  It creates no visible display.

Command Parameters: 
href="URL"
  • Requires that a valid URL be provided.

  • Establishes the base hypertext reference address for all partially defined URLs in the document.

  • All partially defined URLs in the document are immediately preceded by the base hypertext reference address.
target="target name"
  • Defines a default target name for all hypertext reference links within the page.

  • Only frames-capable browsers can interpret the command parameter properly.

  • The target name is a name previously associated with a defined <FRAME> in a framed document, or one of several standard reserved target names described below.

  • Using standard reserved target name _top in a base statement prevents a document from being loaded within the frames of another.

    Standard Reserved Target Names:

    _blank

    Creates a new browser window and displays the document within it.

    _self

    Displays the document in the same browser window.

    _parent

    Displays the document over the document parent.  If there is no parent document then it replaces the contents of the browser window.

    _top

    Clears the current browser display and displays the document at the top level.  If already at the top then the document simply replaces the content of the browser window.

Example:
A Partial Document Head Segment

<HEAD>
  <BASE href="http://www.netstrider.com/HTMLRef/" target="_top">
</HEAD>

  • Establishes the base URL http://www.netstrider.com/HTMLRef/ as the default hypertext reference within the entire document.

  • All partially defined URLs within the document will be automatically preceded by this base URL.

    The hypertext reference anchor

      <A href="index.html">Home Page</A>

    appearing anywhere within this document would generate the following URL:

      http://www.netstrider.com/HTMLRef/index.html

    when the partially defined hypertext reference link Home Page were followed.

  • Establishes the standard reserved target name _top as the default target for all hypertext reference links within the document.

  • If this page were loaded from within a framed document it would clear the browser window and load at the top of the page.
Return to Section A:D


Return to the List of Commands.
Author: Randy D. Ralph.  In place March 1, 1999.  Copyright © 1999 NetStrider.  World Rights reserved.




Hosted by uCoz