BASE (<base>) Tag

by Jai 28-May-19

0 326

The <base> Tag is used to identify a base URL that targets for all relative URLs in a document. Basically, the <base> tag is always written inside head Tag.

The <base> tag contain two important attributes i.e. href and Target in which href is mandatory whereas the target attribute is an optional. This base tag work for relative URL.

For Example:
When we are creating an anchor link, the href attribute is used to specify an absolute URL (base URL), like or a relative URL such as ( /, /page-name). Relative URL may have /, /page-name.

Browsers Support:

Google Chrome
Internet Explorer

BASE (<base>) Tag

BASE (<base>) Tag

BASE (<base>) Tag

BASE (<base>) Tag


<!DOCTYPE html>
<title> HTML base Tag </title>
<base href="" target="_blank">
<h2> HTML Base Tag </h2>
<p> <a href="/html-meta-tags"> Coding Tag </a>
You notice that when click on this above link(Coding Tag) it is open in new window tab <br>
even it has no any target (target="_blank") attribute.
<br>it happen because of target attribute of the base element is set to "_blank".


BASE (<base>) Tag



    Waiting for your comments

Leave a Reply