HTML <base> Tag
Example
Specify a default URL and a default target for all links on a page:
<head>
<base href="http://www.w3schools.com/images/" />
<base target="_blank" />
</head>
<body>
<img src="stickman.gif" />
<a href="http://www.w3schools.com">W3Schools</a>
</body> |
Try it yourself » |
Definition and Usage
The <base> tag specifies a default address or a default target for all
links on a page.
The <base> tag goes inside the head element.
Browser Support

The <base> tag is supported in all major browsers.
Differences Between HTML and XHTML
In HTML the <base> tag has no end tag.
In XHTML the <base> tag must be properly closed.
Attributes
DTD indicates in which HTML 4.01/XHTML 1.0
DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
| Attribute |
Value |
Description |
DTD |
| href |
URL |
Specifies a base URL for all relative URLs on a
page |
STF |
| target |
_blank
_parent
_self
_top
framename |
Specifies where to open all the links on a page |
TF |
Standard Attributes
The <base> tag does not support any standard attributes.
More information about Standard Attributes.
Event Attributes
The <base> tag does not support any event attributes.
More information about Event Attributes.
Click here to design a Stunning Flash Website for Free
Wix is a revolutionary web design tool that provides anyone with the possibility to create professional and beautiful websites for free.
With e-commerce features, search engine visibility and many more professional tools, Wix is the ultimate solution for creating a spectacular site while saving tons of money.
 |
W3Schools' Online Certification Program
The perfect solution for professionals who need to balance work, family, and career building.
More than 4500 certificates already issued!
|
The HTML Certificate documents your knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
|