Base HTML: Base Tag in HTML, Uses, and Syntax

The Base HTML or HTML <base> tags are used to specify a base URL for a specific link. Read here to explore <base> HTML in detail.
authorImageVarun Saharawat30 Oct, 2025
Base HTML: Base Tag in HTML, Uses, and Syntax

Base HTML: HTML tags are the components of markup language HTML used at the start and end of an HTML element for different attributes and functions in an HTML document. HTML is a strong markup language used for creating the structure of the web page. The tags in the HyperText Markup Language are used to make the browser read or identify HTML documents. 

The base tags in the HTML document are used to specify the base URL or URI for all relative links within an HTML document. Let us know more about the <base> tag in this article.

What is Base HTML?

Base HTML is a tag used in HTML to specify a base URL link for all relative links on an HTML document. The base tag is used to set the base URL for the document which is used by the browsers to resolve the relative URLs easily.  The base tag is represented by <base>. They contain a src attribute to enclose the relative link for the HTML document.

Syntax for HTML Base Tag

The syntax used to specify the HTML base tag is given below. The tag consists of a href which encloses the relevant link. There can only be one base element within an HTML document.
<base href=”https://pwskills.com”>

Base HTML Template Example 

Let us understand the implementation or use of HTML base tags inside an HTML document. The table below consists of the base tag enclosing a relevant link, https:// pwskills.com/base-path/.  The base tag sets the base URL to https:// pwskills.com/base-path/. Hence, any URL on the document will be resolved based on the base URL.
HTML Base tags
<!DOCTYPE html> <html lang="en"> <head>   <meta charset="UTF-8">   <meta name="viewport" content="width=device-width,  initial-scale=1.0">   <base href=" https:// pwskills.com/base-path">   <title>Document</title> </head> <body>   <!-- Other HTML content with relative URLs →   <a href="page.html">Link to Page</a>   <img src="images/image.jpg" alt="Image"> </body> </html>

Important Facts about the Base HTML tag

Check some of the major highlights of the Base HTML tag used in the HTML document below.
  • HTML base tag is used to specify the base URL for all relevant links within an HTML document.
  • You can only specify one <base> element in an HTML document. 
  • We can also specify whether the link will open in the same window or a new window by setting the target attribute.
  • The HTML base tag does not consist of a closing tag. However, in XHTML end tag is required.
  • It is used in anchors and links.
  • It is supported on various browsers such as Chrome, Safari, Opera, Firefox, etc.
  • The <base> tag does not support the event attribute in HTML.
  • It supports all the global attributes in HTML.

HTML Base Tags Attributes 

Let us know some of the major attributes used with the base tag of HTML.
HTML Base Tags Attributes 
Name of attribute Value  Definition
href URL link Used to specify the URL for all relative links in an html document.
Target value  _blank It opens the relative link in a new window.
_self It is used to open the link on a current window.
_parent It opens the link in the parent tab.
_top It is used to open the links in full size.

Examples of HTML Base tags with Blank Attribute

Let us understand the use of blank attributes with the base tag of HTML. The blank attribute is frequently used with the base tags as they quickly open the links in a new window without disturbing the current tabs or others. You must specify one of the attributes while working with the base HTML tags.
HTML Base tags
<!DOCTYPE html> <html lang="en"> <head>   <meta charset="UTF-8">   <meta name="viewport" content="width=device-width,  initial-scale=1.0">   <base href=" https:// pwskills.com/base-path" target = “_blank”>   <title>Document</title> </head> <body>   <!-- Other HTML content with relative URLs →   <a href="page.html">Link to Page</a>   <img src="images/image.jpg" alt="Image"> </body> </html>
You can easily specify the blank attribute within the base tag under the target.

List of Supported Browsers for HTML Base tags

Some major web browsers which support the HTML base tags are mentioned below.

Learn Full Stack Web Development With PW Skills

Join our Full Stack Web Development Course to gain mastery in MERN stack web development. The course will help you learn modern technologies for web development which helps to create and power modern web applications. The course comes with many perks such as relevant industry-level projects, regular assessments, Professional development, a Q&A Forum, PW Lab access, Course completion certificate with 100% placement assistance. Hurry and know more about the course only at @pwskills.com.

HTML Base Tag FAQs

What are HTML base tags?

Base HTML is a tag used in HTML to specify a base URL link for all relative links on an HTML document. The base tag is used to set the base URL for the document which is used by the browsers to resolve the relative URLs easily.

Are there closing tags used in base HTML?

No the base html tags do not use closing tags. It only consists of an opening tag.

What is the syntax of the Base HTML tag?

The base HTML tag syntax is <base href=”https://pwskills.com”

Do HTML base tags support event attributes?

No HTML base tag does not support event attributes.