home HOME

Full Overview

HTML Tags

<!-->
<!DOCTYPE>
<a>
<abbr>
<acronym>
<address>
<applet>
<area>
<b>
<base>
<basefont>
<bdo>
<big>
<blockquote>
<body>
<br>
<button>
<caption>
<center>
<cite>
<code>
<col>
<colgroup>
<dd>
<del>
<dfn>
<dir>
<div>
<dl>
<dt>
<em>
<fieldset>
<font>
<form>
<frame>
<frameset>
<head>
<h1> - <h6>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<label>
<legend>
<li>
<link>
<map>
<menu>
<meta>
<noframes>
<noscript>
<object>
<ol>
<optgroup>
<option>
<p>
<param>
<pre>
<q>
<s>
<samp>
<script>
<select>
<small>
<span>
<strike>
<strong>
<style>
<sub>
<sup>
<table>
<tbody>
<td>
<textarea>
<tfoot>
<th>
<thead>
<title>
<tr>
<tt>
<u>
<ul>
<var>

pixels

HTML <base> tag


Definition and Usage

The base element specifies a base URL for all the links in a page.


Differences Between HTML and XHTML

In HTML the <base> tag has no end tag.

In XHTML the <base> tag must be properly closed.


Tips and Notes

Note: The <base> tag must go inside the head element.


Example

Assume that the absolute address for an image is:

<img src="../images/smile.gif" />

Now we insert the <base> tag, which specifies a base URL for all of the links in a page, in the head section of a page:

<head>
<base href="../images/" />
</head>

When inserting images on the page in the example above, we just have to specify the relative address, and the browser will look for that file using the full URL, "../images/smile.gif": 

<img src="smile.gif" />


Required Attributes

DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.

Attribute Value Description DTD
href URL Specifies the URL to use as the base URL for links in the page STF

Optional Attributes

Attribute Value Description DTD
target _blank
_parent
_self
_top
Where to open all the links on the page. This attribute can be overridden by using the target attribute in each link.
  • _blank - all the links will open in new windows
  • _self - all the links will open in the same frame they where clicked
  • _parent - all the links will open in the parent frameset
  • _top - all the links will open in the full body of the window
TF

Standard Attributes and Events

NONE


Try-It-Yourself Demos

One target for all links
How to use the <base> tag to let all the links on a page have the same target.



Add automated outbound phone calls to your application!

   Enhance your project with this inexpensive reliable Web Service. Phone calls can be sent as pre-recorded sound files, text to speech, or by using a combination of both. You can also change call flow based on interaction.

Phone Notify! is being utilized for fraud prevention, emergency notification calls, courtesy calls, automated telemarketing calls, voice broadcasts, automated dialers, appointment reminders and more.

50 FREE phone calls for W3School users >


Jump to: Top of Page or HOME or Printer Friendly Printer friendly page

W3Schools provides material for training only. We do not warrant the correctness of its contents. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.

Copyright 1999-2007 by Refsnes Data. All Rights Reserved.

Validate Validate W3C-WAI level A conformance icon W3Schools was converted to XHTML in December 1999
SITE SEARCH
 
About W3Schools
W3Schools Forum
E Components
Ecommerce
Components
for ASP.NET
WEB HOSTING
$15 Domain Name
Registration
Save $20 / year!
UK Domain Names
UK Web Hosting

Alojamiento Web
Buy UK Domain Names
Register Domain Names
Cheap Domain Names
Cheap Web Hosting
Best Web Hosting
Domain Name Registration
PHP MySQL Hosting
Top 10 Web Hosting
Web Hosting Providers
Web Hosting Company
WEB BUILDING
Convert HTML to XML
Website Templates
Flash Templates
Website Builder
Internet Business Opportunity
Custom Programming
Web Design Forum
Programming Forum
FREE Trial or Demo
Web Content Manager
Forms,Web Alerts,RSS
Free Thumbnail Maker
Free Video Tutorials
HTML Exam
SHOPPING
UK Wholesalers
UK Wholesale
Online Casinos
Batteries
ONLINE DEGREE
Advance Your Career
with Drexel University
Bachelor's & Master's
Tech Degrees ONLINE
US Web Design Schools
YELLOW PAGES
www.nettkatalogen.no
www.gulex.dk
www.gulex.se
www.gelbex.de

pixels