HTML <base> href Attribute
Example
Specify a base URL for all relative URLs on a page:
<head>
<base href="https://www.w3schools.com/images/">
</head>
Try it Yourself »
Definition and Usage
The href
attribute specifies the base URL for all relative URLs on a page.
Browser Support
Attribute | |||||
---|---|---|---|---|---|
href | Yes | Yes | Yes | Yes | Yes |
Syntax
<base href="URL">
Attribute Values
Value | Description |
---|---|
URL | An absolute URL that acts as the base URL (like "http://www.example.com/") |
❮ HTML <base> tag
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.