Internet is collection of link.

Link attribute is most important attribute in a webpage.

<a> tag is used to define a link in webpage. with <a> you use href attribute to define destination of link

HTML Link Syntax

<a href="destinationurl">Text to display</a>

Attributes are provided with start tag of HTML element.

Attribute Description End tag
id ID attribute is used to create bookmark within a HTML webpage. </p>
target target="_new" opens link in new tab/window. </p>


Sample Code

<a href="#section2">Go to Section 2</a> takes user to section 2 marked in same webpage.


<a href="">Go to Section 2</a> takes user to section 2 from another webpage.


By default, links will appear as follows in all browsers:

  • An unvisited link  (link that is not clicked) is underlined and shown blue
  • A visited link (clicked) is underlined and purple
  • An active link is underlined and red

You can create your own style to override above behavior/

Attributes    Blocks    Color-Values    Colornames    Colors    Comments    CSS    Editors-for-writing-html    Elements    Entities    Formatting-in-HTML    Forms    Head    Headings    HTML-Reference    IFrames    Image    Javascript    Layouts    Links    Options for building websites    Paragraphs    pointers and questions    Symbol-for-Mathmatics    Symbol-for-Punctuations    Symbols    Tables    Whats-new-in-HTML5