HTML – An Anchor Tag or Link Tag

anchor tag

HTML allows linking to other Html documents as well as images. Clicking on a selection of text or an image on one web page will open an entire web page or an image.

Text or image that provides such linkages is called hypertext, hyperlink, or a hotspot. Browser distinguishes hyperlinks from normal text. Hyperlinks appear blue in color Blue is the default color in a browser for hyperlinks Color can be dynamic if required.

Hyperlink text or image underlined. When the mouse cursor is placed over it, the standard arrow-shaped mouse cursor changes to the shape of a hand. To change the settings of hyperlinks, there are three attributes in the body tag. 

  • Link-changes the default color of a hyperlink to whatever color is specified with this tag 
  • A link changes the default color of a hyperlink that is activated to whatever color is specified with this tag. 
  • Vlink-changes the default color of a hyperlink that is already visited whatever color is specified with this tag. 

Creating a Hyperlink

 
HTML Anchor Tag

Hyperlinks are those little spots you click on to go somewhere else on the web. Can create a hyperlink with the anchor tag. 

HTML Code

<a href='https://www.google.com'>Click here for Google visit</a>
<a href='https://www.facebook.com/'>Click here for Facebook visit</a>
<a href='http://bing.com/'>Click here for Bing visit</a>

HTML Output

Click here for Google visit
Click here for Facebook visit
Click here for Bing visit

HTML Links With Target Attribute

The target attribute specifies where to open the link. If you use the target attribute it will help you to open your link in New Browser or New Tab.

The Values of Target Attribute

Values Description
_blank Opens the linked document in new window or tag
_self Opens the linked document in the same frame as it was clicked.
_parent Opens the linked document in the parent frame
_top Opens the linked document in the full body of the window
Framename Opens the linked document in a named frame

HTML Code

<a href='https://tutsmaster.org/' target='_blank'>TutsMaster</a>

HTML Output

TutsMaster.org