WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML <base> Tag


Example

Specify the default URL and default destination for all links on the page:

<head>
<base href="http://www.welookups.com/pictures/" target="_blank">
</head>

<body>
<img src="stickman.gif" width="24" height="39" alt="Stickman">
<a href="http://www.welookups.com">welookups</a>
</body>
Try it yourself »

Definition and Usage

<base> Tags specify a default URL or default destination for all relative links on the page.

Use up to one in a document <base> element. <base> The label must be located <head> Element inside。


Tips and comments

Tip: Please put <base> Labels ranked <head> The position of the first element in the element so that other elements in the head area can be used <base> Information in the element.

Note: If used <base> A tag must have either the href attribute or the target attribute or both.


Browser Support

Element
<base> Yes Yes Yes Yes Yes Yes

Differences Between HTML 4.01 and HTML5

NONE.


Differences Between HTML and XHTML

<base> Tags specify a default URL or default destination for all relative links on the page.

Use up to one in a document <base> element. <base> The label must be located <head> Element inside.


Attributes

Attribute Value Description
href URL Specifies the base URL of all relative links in the page.
target _blank
_parent
_self
_top
framename
Specifies where all hyperlinks and forms on the page open. This attribute is overridden by the target attribute in each link.