Skip to main content

The <base> Element

As defined in the HTML Living Standard, the <base> element allows authors to specify the document base URL for the purposes of resolving relative URLs, and the name of the default browsing context for the purposes of following hyperlinks.

Conceptual Usage:

If you set the base URL to https://example.com/assets/, a link like <a href="logo.png"> will resolve to https://example.com/assets/logo.png.

<head> <base href="https://www.simpleaccess.io/" target="_blank"> </head> View HTML Living Standard: The base element

Technical Requirements & Constraints

WCAG Requirement: Link Purpose

Success Criterion 2.4.4 (Level A): The purpose of each link can be determined from the link text alone or from the link text together with its programmatically determined link context.

When using <base>, ensure that relative links still resolve to meaningful destinations. If a developer incorrectly sets the base URL, every relative link on the page becomes a broken experience for keyboard and screen reader users.

Understand SC 2.4.4: Link Purpose

Critical Accessibility Risks

Improper use of the <base> tag can create significant accessibility barriers:

A11y Tip: Be Explicit

Avoid using <base target="_blank">. It is better to handle link targets explicitly on a per-link basis and inform the user when a link will open in a new window to satisfy WCAG SC 3.2.2 (On Input).