HTML <base> Tag
In this tutorial, we will learn about base tag in HTML with the help of examples.
Base tag <base> is used to specifies the base URL
for all relative URL in a document.
A base URL is the consistent part of your web address i.e. every URL follows the base URL.
We can use only one base tag in an HTML document inside the head tag only.
<base> tag is declared inside <head> tag.
Note : The base tag must have an href attribute present in it.
<base href = "www.google.com" target = "_blank">
<a>It's harder to read code than to write it.</a>
|href||URL||Specifies the URL of a page or the name of the anchor we want to hyperlink the document|
|Specifies where to open the target URL
_blank = the target URL will open in a new window.
_self = the target URL will open in the same frame as it was clicked.
_parent = the target URL will open in the parent frameset.
_top = the target URL will open in the full body of the window
Base Tag support all the global attributes of HTML.
Base Tag support all the event attributes of HTML.
We hope that this tutorial helped you develop better understanding of the concept of Base tag in HTML.
Keep Learning : )
In the next tutorial, you'll learn about HTML