HTML <base> with target Attribute

You are Here:

HTML <base> with target Attribute

The target attribute specifies where to display the result when hyperlinks or forms cause navigation.

_blank

The _blank attribute value will display the result in a new window, when hyperlinks or forms cause navigation.

Example

HTML Online Editor
<!DOCTYPE html> <html> <head> <title>HTML base Tag</title> <base href="https://wikimass.com/" target="_blank"> </head> <body> <a href="/css">Learn CSS</a><br> <a href="/js">Learn Javascript</a><br> <a href="/jquery">Learn Jquery</a><br> </body> </html>

Attribute Value

ValueExplanation
_blankDisplay the result in a new window, when hyperlinks or forms cause navigation.
_selfDisplay the result in the same frame, when hyperlinks or forms cause navigation. Default.
_parentDisplay the result in its parent frame, when hyperlinks or forms cause navigation.
_topDisplay the result in the complete window by breaking all the frames it is nested, when hyperlinks or forms cause navigation.

_self

The _self attribute value will display the result in the same frame, when hyperlinks or forms cause navigation.

This is the default behavior.

Example

HTML Online Editor
<!DOCTYPE html> <html> <head> <title>HTML base Tag</title> <base href="https://wikimass.com/" target="_self"> </head> <body> <a href="/css">Learn CSS</a><br> <a href="/js">Learn Javascript</a><br> <a href="/jquery">Learn Jquery</a><br> </body> </html>

_parent

The _parent attribute value will display the result in its parent frame, when hyperlinks or forms cause navigation.

Example

HTML Online Editor
<!DOCTYPE html> <html> <head> <title>HTML base Tag</title> <base href="https://wikimass.com/" target="_parent"> </head> <body> <a href="/css">Learn CSS</a><br> <a href="/js">Learn Javascript</a><br> <a href="/jquery">Learn Jquery</a><br> </body> </html>

_top

The _top attribute value will display the result in the complete window by breaking all the frames it is nested, when hyperlinks or forms cause navigation.

Example

HTML Online Editor
<!DOCTYPE html> <html> <head> <title>HTML base Tag</title> <base href="https://wikimass.com/" target="_top"> </head> <body> <a href="/css">Learn CSS</a><br> <a href="/js">Learn Javascript</a><br> <a href="/jquery">Learn Jquery</a><br> </body> </html>

Reminder

Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in HTML.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author