Definition and Usage The href attribute specifies the default frame/window in which to open all URLs (web resource) for a page. Syntax ...
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.1000sourcecodes.com/" target="_blank" />
</head>
<body>
<p>A relative URL: <a href="default.asp"> HTML Reference</a></p>
</body>
</html> |