HTML Links


HTML HTML Links Target Attribute

HTML Link or Hyperlink

link or hyperlink is a connection that allows you to move from one page to another. Link may be text, image, video or any other Html element.

Example:-

<a href="https://www.codingpk.com">Visit our Website Codingpk</a>

Output:-

Visit our website codingpk

When you bring cursor on link or hyperlink hand icon appears and link become underlined.

Html link Colors

Unvisited link is underline and blue. Visited link is underline and purple. Active link is underline and red. Note:You can change color of the link.

Html Link Syntax

Starting tag for link is . Closing tag for link is .

<a href="URL">Text For Link</a>

href attribute specify destination address.

Html Image as Link

You can use image as link.

Example:-

<a href="https://codingpk.com/Post/Tutorial/learn_html_in_short_cource"> <img src="" alt="HTML tutorial" style="width:100px;height:100px;border:0;"> </a>

Output:-

Target Attribute in Link

The target attribute define where to open the linked document. Its value can be:

  • _blank (open link document in new tab/window).
  • _self (open link document in same tab/window).
  • _parent (open link document in parent frame).
  • _top (open link document in whole body of tab/window). Note:-By default target attribute value is _self.

    Example:-

    <a href="https://codingpk.com/Post/Tutorial/html_links" target="_blank "> Visit our Website Codingpk</a>

    Output

    Visit our Website Codingpk Html Tutorial
  • HTML Target Attribute Chapter Next »