Menu
Document Structure & Metadata

<base> Tag

Set a base URL for all relative links on the page.

1Setting a Base

A single <base> tag in <head> rewrites every relative href and src to resolve from the given URL. Use it carefully — it affects the whole document.

Example Code
<head>
  <base href="https://cdn.example.com/v2/" />
  <!-- /img.png will resolve to https://cdn.example.com/v2/img.png -->
</head>

Finished reading?

Mark this topic as complete to track progress.