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
 |
W3Schools' Online Certification Program
The perfect solution for professionals who need to balance work, family, and career building.
More than 4000 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).
|