HTML - a (Anchor) Tag or Link Tag

HTML allows linking to other Html documents as well as images. Clicking on a selection of text or an image in 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.

HTML allows linking to other Html documents as well as images. Clicking on a selection of text or an image in 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 appears blue in color Blue is the default color in a browser for hyperlink Color can be dynamically if required. Hyperlink text or image is 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 hyperlink there are three attributes in body tag. 
  • Link-changes the default color of a hyperlink to whatever color is specified with this tag 
  • Alink-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 to whatever color is specified with this tag. 

Creating a Hyperlink

HTML Anchor Tag
HTML Anchor Tag
Hyperlinks are those little spots you click on to go somewhere else on the web. Can create 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='http://ansmachine.net/' target='_blank'>AnsMachine</a>

HTML Output

AnsMachine

You May Also Like...