<

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.

Attributes



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

Example




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

<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>



</body>
</html>
















© copyright 2017-2022 Completedone pvt ltd.