Share on Google+Share on Google+

HTML5 base tag, Definition of base tag in HTML5.

We will discuss base tag of HTML5.

HTML5 base tag, Definition of base <base> tag in HTML5.

In this tutorial, we will introduce you to  <base> tag of HTML5. Base tag allows to author to specify defaults URL for resolving relative URL's of all document.
We can define URL in base tag if there is different link has same URL in a document .

Attributes of base tag.

Attribute is used for defining the behavior of tag. There are two attributes in base tag .
1- href - Href attribute used for defining default URL.
2-target- Target attribute tells the browser where to display linked document.

Declaration Syntax :

Declaration syntax of Base in HTML5.

                            <base href="value" target="value">

The declaration of base  is case_ insensitive.

Example of <base> in HTML5:



<!Doctype HTML>
<base href=""
<title>Insert title of document.</title>
<p><b>Example of base <base> tag in HTML5.</b></p>
<abbr title="Information Technology" >IT</abbr> company </b>
<p>&nbsp;<a href="IDE/Eclipse/index.shtml">
Depend on base tag URL.</a></p>
<p>&nbsp;<a href="tutorial/html/html5/index.html">
Depend on base tag URL.</a></p>
<a href=""
 target="_blank">About Rose India Technology </a> 

Note: See the browser compatible page for successfully rendering the program.

Download this code

Difference Between HTML5 and HTML4.01:

There is no difference in base tag.


Posted on: September 2, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null