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 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 appear blue in colour Blue is the default colour in a browser for hyperlink Color can be dynamical 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 the body tag. 

  • Link-changes the default colour of a hyperlink to whatever colour is specified with this tag 
  • A link-changes the default colour of a hyperlink that is activated to whatever colour is specified with this tag. 
  • Vlink-changes the default colour of a hyperlink that is already visited whatever colour 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

ValuesDescription
_blankOpens the linked document in new window or tag
_selfOpens the linked document in the same frame as it was clicked.
_parentOpens the linked document in the parent frame
_topOpens the linked document in the full body of the window
FramenameOpens the linked document in a named frame

HTML Code

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

HTML Output

TutsMaster.org

TutsMaster.org

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.