HTML Link

    1100599 VIEW 1 0

A link or hyperlink is a connection from one web resource to another. Links allow users to move seamlessly from one page to another, on any server anywhere in the world.

An anchor is used to define the beginning and end of a hypertext link. which may be any web resource, for example, an image, an audio or video clip, a PDF file, an HTML document or an element within the document itself, and so on.

HTML Link Syntax

Links are specified in HTML using the <a> tag.

<a href="url">link text</a>
 
where href stands for hypertext reference. This attribute defines the target address of the document, which this time is linked to (https://www.//hyper.mirganj.in)

By default, links will appear as follow in most of the browsers:

  • An unvisited link is underlined and blue.
  • A visited link is underlined and purple.
  • An active link is underlined and red.

The target attribute specifies the location where link should be opened.

The target attribute can have one of the following values:

  • _blank — Opens the linked document in a new window or tab
  • _self — Opens the linked document in the same window/tab 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.

Title attribute

The title attribute gives users an important indication as to where they will be directed to when they click on a link. If the user hovers with the mouse over a link reference, the title text, which was defined in the attribute, will be displayed.