Create hyperlink in HTML

Hyperlink or link point out to a document or any element within the document. The text with the link is known a hypertext.

create-hyperlink-in-htmlWhen a mouse rollover on a hyperlink, the cursor changes to a small hand which shows the presence of link. Clicking on the link gets navigated to a new page or website.

It appears as “This text has a hyperlink

The HTML code for creating a hyperlink to a text looks like

In the place of # put your website

The link can be opened in the same page or in new tab. To open in the same window just add “target=_parent” within the ‘a’ tag and to open in the new window “target=_blank”.

Link open in the same window

Link open in the new window

The default color of the hypertext is blue. It can be changed by specifying the color in the body tag.

Where the hypertext appear in red color, visiting link appear to be green in color and the active link appear in blue color.

Image can also be hyperlinked.

A hyper linked image shows a blue border as default and to remove tat add “border=“0”” to the code in the ‘a’ tag. Height and width attribute are specified with the image for quick loading of the page


Creating email link:
To create an email link just add “mailto:” to the email address.

Anchor links are used to navigate to the section of content in the same page where the link is located.

  • Select the section of the page where the browser move when clicked on a link
  • Name the section like Part of the section
  • The hyperlink text to the section of the page. Link to the part of section
  • Anchor link should contain hash (#) mark with the anchor name
Link to the top of the page
Link to the top of the page

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>