HTML5 Tutorial: Anchor Tag- Open Link in a New Window Tab

What is Hyper Linking?

Hyper Linking is the process of connecting one Webpage page to Another.

Making the link Clickable and allowing users to click their way from page to page.

Create a hyperlink to a location on the web?

In HTML this is done by Anchor Tag,

Predefined targets for Anchor Tag are:

  • _blank
  • _self 
  • _parent
  • _top

The functionality of Predefined Targets

  • _blank loads the page into a new browser window.
  • _self loads the page into the current window.
  • _parent loads the page into the frame that is superior to the frame.
  • _top cancels all frames and loads in full browser window.

How to Make Links Open in a New Tab?

To make the link open in New Tab Simply add target=_Blank in Anchor Text

LINK TO EMAIL IN HTML USING ANCHOR TAG

Email links are done much the same as links to other pages, using the Anchor Tag i.e. <a href> tag.

with a slight difference of adding mailto: your email address

Let’s assume your email as email@example.com

your final link will be <A href=”mailto:email@example.com”>Email Me</a>

<a href="https://www.primebuzzer.com/HTML5-Anchor-Hyperlinking" target="_top">How to Make Links Open in a New Window or Tab</a>

To spice up the mail Link, Let’s Add Subject and predefined text

add  subject= desired text for the predefined subject

and body= desired body text

So if you made a text link for help on your website. New HTML code will be

<A href=”mailto:email@example.com?subject=Support Required&body=Help Me! i am Stuck”>Help Me</a>

Note: You need to use & while connecting both subject and body. Also , take care of double quotes

Note: Clicking such link will open user default set Email Client, Which in recent windows is Microsoft Outlook if office installed.

7 thoughts on “HTML5 Tutorial: Anchor Tag- Open Link in a New Window Tab”

    1. You need to use Css and need to follow certain rules,
      In todays era it is need of an hour to have Mobile ready Website

  1. You explained in such a great manner.
    You earned my respect. I loved your blog.
    Straightforward and to the point

Leave a Comment

Your email address will not be published. Required fields are marked *

You cannot copy content of this page