<base>
DocumentSelf-closingSpecifies the base URL and target for all relative URLs in the document. Only one base element is allowed per page.
Common Attributes
hreftargetExample
<base href="https://example.com/" target="_blank">
About the <base> Element
The <base> HTML element belongs to the Document category of HTML elements. Specifies the base URL and target for all relative URLs in the document. Only one base element is allowed per page. Understanding when and how to use this element is essential for building well-structured, accessible, and SEO-friendly web pages.
As a void (self-closing) element, <base> does not have a closing tag. It is written as <base> or <base /> in XHTML syntax. This element is part of the current HTML Living Standard and is supported in all modern browsers including Chrome, Firefox, Safari, and Edge.
Proper use of semantic HTML elements like <base> improves document structure, helps screen readers interpret content correctly, and provides signals to search engines about the purpose of different sections of your page. This leads to better accessibility scores, improved SEO rankings, and more maintainable code.