HTML base target Attribute
HTML <base> tag
Definition and Usage
The href attribute specifies the default frame/window in which to open all URLs (web resource) for a page.
Syntax
Syntax Example
Attribute Values
Value |
Description |
_blank |
The target URL will open in a new window. |
_self |
The target URL will open in the same frame as it was
clicked. |
_parent |
The target URL will open in the parent frameset. |
_top |
The target URL will open in the full body of the window. |
framename |
The name of the target frame the URL should open in. |
Browser Support

The attribute is supported in all major browsers.
Tips and Notes
Note: The base element must be in <head>.
Example
<html>
<head>
<base href="http://www.w3schools.com/" target="_blank" />
</head>
<body>
<p>A relative URL: <a href="default.asp">HTML Reference</a></p>
</body>
</html>
|
Try-It-Yourself Demos
base target
attribute example
Set the default link target window of the page.
HTML <base> tag
Whether you're new to XML or already an advanced user, the user-friendly views
and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to
meet your XML and Web services development needs from start to finish.
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!
Download a fully functional free 30-day trial today!
|