Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML <base> Tag

  • Last Updated : 05 Feb, 2021

The HTML base tag is used to specify a base URI, or URL, for relative links. This URL will be the base URL for every link on the page and will be prefixed before each of them. For example, if the URL specified by the + 
base tag is “” and then every other URL on the page will be prefixed by, “”.

Important Points:

  • The base tag must be defined between the head tags.
  • There can be a maximum of only 1 base tag in a page.


<base href = "SAMPLE_URL">

Example: Notice that we have only specified a relative address for the image. Since we have specified a base URL in the head section, the browser will look for the image at “”. That is in the below program we have specified a base URL “” for all the links and when we are referring to the image at URL “1-95.jpg” then the browser is actually rendering the image from “”. 


<!DOCTYPE html>
    <!-- Declaring the BASE URL -->
    <img src="1-95.jpg" width="400" height="250" />


Supported Browsers:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!