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> |
View it » |
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
|
|