HTML 5 <base> Tag
Example
Specify a default URL and a default target for all links on a page:
<head>
<base href="http://www.w3schools.com/css/" target="_blank" />
</head>
<body>
<a href="default.asp">W3Schools' CSS Tutorial</a>
</body> |
Try it yourself » |
Definition and Usage
The <base> tag specifies a default URL, and/or a default target, for all
elements with a URL (hyperlinks, images, forms, etc.).
The <base> tag must go inside the head element.
Differences Between HTML 4.01 and HTML 5
None
Tips and Notes
Tip: Put the <base> tag as the first element in the head
element, so that other elements in the head section uses the information from
the <base> element.
Note: Maximum one <base> element in a
document.
Attributes
| Attribute |
Value |
Description |
| href |
URL |
Specifies the URL to use as the base URL for links in the page |
| target |
_blank
_parent
_self
_top |
Where to open all the links on the page. This attribute can be overridden by
using the target attribute in each link.
- _blank - all the links will open in new windows
- _self - all the links will open in the same frame they where clicked
- _parent - all the links will open in the parent frameset
- _top - all the links will open in the full body of the window
|
Standard Attributes and Events
NONE
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).
|