Definition and Usage The href attribute specifies the base (default base location) URL for a page. Syntax <base href=" URL...
Definition and Usage
The href attribute specifies the base (default base location) URL for a page.
Syntax
Syntax Example
<base href="http://www.1000sourcecodes.com/" /> |
Attribute Values
Value | Description |
URL | The web resource/address to use as a base URL for the page.Possible URL values:
- An absolute URL - An URL with full address is required (like href="www.example.com")
|
Browser Support
The attribute is supported in all major browsers.
Tips and Notes
Note: The base element must be in the <head> element.
Note: The base element does not work as intended when using anchor URLs (like href="#bottom"). It will then reload the page.
Tip: All URLs should be URL encoded when required.
Example
<html>
<head>
<base href="http://www.1000sourcecodes.com/" />
</head>
<body>
<p><a href="default.asp">1000sourcecodes.com</a></p>
</body>
</html> |