HTML Hyperlinks

This lesson will guide us on how to create hyperlinks in HTML

Hyperlinks or also known as links is a text or image that can send or move you to a different webpage by clicking the hyperlink or link.

You can determine if a text or image has link if you hover your mouse cursor to it,   the arrow sign will turn into a little hand.

Here is an example of code that creates a link:

<a href=”url”>nameOfLink</a>

Where:

<a> </a> is the tag that defines the hyperlink

href (hyperlink reference) is the attribute that indicates the destination page of the link.

url is the complete internet address or name of the website. It could also be in a form of a image, music, video or executable file.

nameOfLink is the text you want to appear in the browser

Example:

<a href="http://www.inettutor.com">Visit inettutor</a>

Image link

<a href="http://www.inettutor.com"><img src="sample.jpg" /></a>

Download sample image:

[wpdm_file id=13]

Note: your html file and the image should be on the same directory, if not the image will not be displayed in the browser.

Target attribute

The HTML target attribute specifies the destination link where it will open. The following are the target options:

_self : Opens in the same window and same frame.

_top : Opens in the same window, taking the full window if there is more than one frame.

_parent : Opens in the parent frame.

_blank : Opens in a new window or a new tab.

<a href=" http://www.inettutor.com" target="_blank">Visit inettutor</a>

Note: if no target attribute is set, the link will open in the same window or tab.

Post navigation

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.