Base Tag in HTML | HTML Tags | Base Tag Example

BASE (<base>) Tag


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 the head Tag.

The <base> tag contains two important attributes i.e. href and Target in which href is mandatory whereas the target attribute is optional. This base tag work for the 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


<!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".


Best WordPress Hosting


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price

Leave a Reply

    Waiting for your comments