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.


Attribute Value Description
href URL Specifies the base URL for all relative URLs in the page
target _blank
Specifies the default target for all hyperlinks and forms in the page


<!DOCTYPE html>
  <base href="http://www.javameant.com/" target="_blank">

<p><img src="logo.png" width="24" height="39" alt="logo"> - Notice that we have only specified a relative address for the image. Since we have specified a base URL in the head section, the browser will look for the image at "http://www.javameant.com/logo.png".</p>


© copyright 2017-2022 Completedone pvt ltd.