Home Tutorial Html Html5 HTML5 base tag, Definition of base tag in HTML5.

 
 

HTML5 base tag, Definition of base tag in HTML5.
Posted on: September 2, 2010 at 12:00 AM
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.
OR
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:

Code:

BaseTag.html

<!Doctype HTML>
<html>
<head>
<base href="http://www.roseindia.net/"
target="_parent"><base>
<title>Insert title of document.</title>
</head>
<body>
<p><b>Example of base <base> tag in HTML5.</b></p>
<article>
<b>
<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="http://www.roseindia.net/businesssolutions/aboutroseindia.shtml"
 target="_blank">About Rose India Technology </a> 
</body>
</html>
Output:

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.

Related Tags for HTML5 base tag, Definition of base tag in HTML5.:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.