A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/html/html-base-target-attribute/ below:

HTML | <base> target Attribute

HTML | <base> target Attribute

Last Updated : 05 May, 2025

The <base> target Attribute in HTML is used to specify the default target for all hyperlinks and forms in the webpage. This attribute could also be overridden by the use of the target attribute for each hyperlink and the Form. 

Syntax: 

<base target="_blank|_self|_parent|_top|framename" > 

Attribute Values:

Example: This example illustrates the use of target attribute in the <base> element. 

html
<!DOCTYPE html> 
<html> 

<head> 
    <base target="_self"> 
    <title> 
        HTML Base target Attribute 
    </title> 
</head> 

<body style="text-align:center;"> 

    <h1 style="color:green;"> 
            GeeksForGeeks 
        </h1> 

    <h2>HTML Base target Attribute</h2> 
    
    <a href="https://www.geeksforgeeks.org/community/" alt="GFG">
        Geeks Link
    </a>
</body> 

</html>                    

Output:

  

Supported Browsers: The browser supported by HTML base target Attribute are listed below:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4