The <base> tag specifies the base URL/target for all relative URLs in a document.
There can be at maximum one <base> element in a document, and it must be inside the <head> element.
The HTML <base> tag
The <base> tag specifies the base URL/target for all relative URLs in a document.
There can be at maximum one <base> element in a document, and it must be inside the <head> element.
The HTML <base> tag also supports following additional attributes:
|href||URL||Specifies the URL of a page or the name of the anchor that the link goes to.|
|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
</pre> <!DOCTYPE html> <html> <head> <title>HTML base Tag</title> <base href="http://www.musthaan.com" /> </head> <body> HTML: <img src="/images/html.gif" /> </body> </html></pre> <pre>
In this case image request to http://www.musthaan.com/images/html.gif
</pre> <!DOCTYPE html> <html> <head> <title>HTML base Tag</title> <base href="http://www.musthaan.com/external" /> </head> <body> HTML: <img src="/images/html.gif" /> </body> </html></pre> <pre>
In this case image request to http://www.musthaan.com/external/images/html.gif
</pre> <!DOCTYPE html> <html> <head> <title>HTML base Tag</title> <base href="htt