HTML <base> hrefAttribute
Examples
Specifies the base URL for all relative URLs on the page:
<head>
<base href="../images/index.html">
</head>
<base href="../images/index.html">
</head>
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the href attribute.
Definition and Usage
The href attribute specifies the base URL for all relative links on the page.
Syntax
<base href="URL.html">
Attribute Values
| Value | Description |
|---|---|
| URL | An absolute URL that serves as the base URL (for example, "http://www.w3cschool.cc/"). |
Other extensions
HTML <base> Tag