HTML <base> Tag
Description
The <base> HTML element defines the starting point for all relative URLs in an HTML document. It is placed within the <head> section and affects links, images, scripts, and forms throughout the page. Essentially, it tells the browser: “use this URL as the reference for anything that doesn’t have an absolute path.”
By using <base>, developers can simplify URL management. For example, when moving a website to a new domain or reorganizing file structures, relative links automatically adapt without needing to update each individual link. It also ensures that resources referenced relatively behave consistently across the page, preventing broken links or unexpected navigation.
The <base> tag is particularly useful for:
- Centralizing the reference point for multiple relative links.
- Controlling the default behavior of links and form submissions.
- Avoiding errors when copying or restructuring pages across directories or domains.
It’s important to note that <base> can only appear once in a document, and it must be in the <head> section. Its effects are global for the page, so placing it incorrectly or using multiple <base> tags can lead to unexpected behavior.
Properties
Example
Attributes
Global Attributes
The <base> tag also supports the Global Attributes in HTML5
Event Attributes
None
Browser Support
The following information will show you the current browser support for the HTML <base> tag. Hover over a browser icon to see the version that first introduced support for this HTML tag.
This tag is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 25th December 2025
