Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML | <base> href Attribute

Improve Article
Save Article
  • Last Updated : 20 Jul, 2022
Improve Article
Save Article

The HTML | <base> href Attribute is used to specify the base URL for all the relative URL of a page. 

Syntax: 

<base href="URL">

Attribute Values: It contains the value i.e URL which specifies the absolute URL that defines the base URL of the page. for eg.”www.geeksforgeeks.org” 

Example: This Example illustrates the use of href attribute in element. 

html




<!DOCTYPE html>
<html>
 
<head>
    <!-- Declaring the BASE URL -->
    <base href=
          target="_blank">
</head>
<h1>GeeksForGeeks</h1>
<h2>
  HTML | &lt;base&gt;href Attribute
  </h2>
 
<body>
    <img src="1-95.jpg"
         width="400"
         height="250">
</body>
 
</html>

Output:

  

Supported Browsers: The browser supported by HTML | <base> href Attribute are listed below:

  • Google Chrome
  • Edge 12 and above
  • Internet Explorer
  • Firefox 1 and above
  • Opera
  • Safari
My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!