HTMLforall

  HTML | PHP | Forum

HTML <base> tag

Syntax

<base> - </base>

Definition and Usage

The BASE element defines the document's base URI for all the links and references within the document. A document cannot contain more than one BASE element. When present, the BASE element must appear in the HEAD, prior to any elements that include a partial URI.

Required Attributes

Attribute Value Description
href URL Specifies the URL to use as the base URI for links and references in the page

Optional Attributes

Attribute Value Description
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 be opened in new windows
  • _self - all the links will be opened in the same frame they where clicked
  • _parent - all the links will be opened in the parent frameset
  • _top - all the links will be opened in the full body of the window

Example

Source Output
<img src="http://www.htmlforall.com/images/dog.gif">

can be replace by:

<head>
<base href="http://www.htmlforall.com/images/" >
</head>

<img src="dog.gif" >

 

Home

Learn HTML
HTML Tutorial

HTML Reference
HTML by function
HTML by Alphabet

HTML events
HTML attributes
HTML color names

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

 

Copyright 2005-8 Sunilcare.  All Rights Reserved.
Comments or suggestions? Contact us.About us