HTML | <base> href Attribute
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 html element.
<!DOCTYPE html> <html> <head> <!-- Declaring the BASE URL --> <base href= target="_blank"> </head> <h1>GeeksForGeeks</h1> <h2> HTML | <base>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
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- HTML | <a> href Attribute
- HTML | <area> href Attribute
- HTML | <link> href Attribute
- How to get an element by its href attribute ?
- HTML | DOM Area href Property
- HTML | DOM Link href Property
- HTML | DOM Location href Property
- HTML | DOM Base href Property
- HTML | DOM Anchor href Property
- Node | urlObject.href API
- AngularJS | ng-href Directive
- HTML | <bdo> dir Attribute
- HTML | <li> value Attribute
- HTML | alt attribute
- HTML | <img> src Attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : shubham_singh

