Quackit Logo
HTML
CSS
Scripting
Database
Hosting
Design
XML
IMCreator - Free Website Builder

HTML base Tag

The information on this page is based on HTML version 4.01 (which is the current version of HTML). The next version, HTML 5, is currently being written. Here's a list of HTML 5 tags.

The HTML base tag is used to specify a base URI, or URL, for relative links. For example, you can set the base URL once at the top of your page, then all subsequent relative links will use that URL as a starting point.

Example
<html>
<head>
<base href="http://www.quackit.com/javascript/" target="_blank"/>
</head>
<body>
<p>Learn about <a href="javascript_arrays.cfm">JavaScript Arrays</a></p>
</body>
</html>

The link above will actually resolve to http://www.quackit.com/javascript/javascript_arrays.cfm regardless of the URL of the current page. This is because the base URL (http://www.quackit.com/javascript/) is prepended to the (relative) URL indicated in the link (javascript_arrays.cfm)

Attributes:
Attributes specific to this tag:
AttributeDescription
hrefSpecifies the URI/URL to use.
Other Attributes:
AttributeDescription
targetTarget frame/window
Try it yourself!


Also see the HTML 5 version of HTML tags

Enjoy this page?

  1. Link to this page (copy/paste into your own website or blog):
  2. Link to Quackit using one of these banner ads.

Thanks for supporting Quackit!