Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App
Next Article:
HTML | <area> target Attribute
Next article icon

HTML | <base> target Attribute

Last Updated : 05 May, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

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:

  • _blank: It opens the link in a new window.
  • _self: It opens the linked document in the same frame. it is the default value.
  • _parent: It opens the linked document in the parent frameset.
  • _top: It opens the linked document in the full body of the window.
  • framename: It opens the linked document in the named frame.

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:

  • Google Chrome
  • Edge 12.0 and above
  • Firefox
  • Internet Explorer
  • Opera 
  • Safari 

Next Article
HTML | <area> target Attribute

M

manaschhabra2
Improve
Article Tags :
  • Web Technologies
  • HTML
  • HTML-Attributes

Similar Reads

  • HTML <a> target Attribute
    The HTML <a> target Attribute is used to specify where to open the linked document. This attribute enhances the functionality and user experience by allowing developers to control the behavior of links. Syntax<a target="_blank | _self | _parent | _top | framename"\> Attribute Values_blan
    1 min read
  • HTML <form> target Attribute
    In this article, we will see how to open the new tab in HTML using <form> target Attribute, along with understanding its implementation through the examples. The <form> target Attribute in HTML is used to specify whether the submitted result will open in the current window, a new tab, or
    2 min read
  • HTML | <link> target Attribute
    The HTML <link> target Attribute is used to specify the window or a frame where the linked document is loaded. It is not supported by HTML 5. Syntax: <link target="_blank|_self|_parent|_top|framename"> Attribute Values: _blank: It opens the link in a new window. _self: It is the default
    1 min read
  • HTML | <area> target Attribute
    The HTML <area> target Attribute is used to specify where to open the linked document. It works only when href attribute is present in the area elements. Syntax: <area target="_blank|_self|_parent|_top|framename"> Attribute Values: _blank: It opens the link in a new window._self: It is t
    1 min read
  • HTML | <basefont> size Attribute
    The HTML <basefont> size Attribute is used to specify the default font-size of document. There are two more attributes for <basfront> tag face and color that specify the color of the text and font-family of the text. The <basfront> tag is not supported in HTML 5. Syntax: <basefo
    1 min read
  • HTML <base> href Attribute
    HTML <base> href Attribute specifies the base URL for all relative URLs in a document, serving as the reference point for resolving relative links and resources. Syntax:  <base href="URL">Attribute Values: It contains the value i.e URL which specifies the absolute URL that defines the ba
    1 min read
  • HTML | <embed> src Attribute
    The HTML <embed> src Attribute is used to specify the web address of the embedded content. Syntax: <embed src="URL"> Attribute Values: URL: It is used to specify the web address of the embedded content.An absolute URL: It points to another webpage.A relative URL: it points to a file with
    1 min read
  • HTML target Attribute
    The HTML target Attribute is used to specify where to open the linked document. It can be used on various elements such as: HTML <a> target AttributeHTML <area> target AttributeHTML <base> target AttributeHTML <form> target AttributeSyntax: <element target="_blank|_self|_p
    2 min read
  • HTML <a> rev Attribute
    The HTML <a> rev attribute is used to define the relationship between the linked document and the current document. This attribute is reversed of HTML rel attribute. It is not supported in HTML5. Syntax: <a rev="value">Attribute values: alternate: It defines an alternative version of the
    2 min read
  • HTML | <a> rel Attribute
    The rel attribute is used to specify the relationship between the current and the linked document. It is used only when the href attribute is present. Syntax: <a rel="value">Attribute Values: alternate: It defines an alternate version of the document i.e. print page, translated, or mirror.auth
    1 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences