Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Home

/ Courses
/ Complete HTML / HTML5 Crash Course.
/ Lessons
/ HTML Links

 Go to course home

The HTML anchor tag defines a hyperlink that links one page to another page. It can create hyperlink
to other web page as well as files, location, or any URL. The “href” attribute is the most important
attribute of the HTML a tag. and which links to destination page or URL.

The link starts at the source anchor and points to the destination anchor, 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.

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.

HTML Link Syntax


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

A link or hyperlink could be a word, group of words, or image.

<a href = “…the url ……..”> Link Text </a>

Example

<p>Click on <a href=”https://lab.thecloudde.com/” target=”_blank”>


Click this-link </a>to go on home page of Cloudde.</p>
Run Code

HTML Links – The target Attribute


By default, the linked page will be displayed in the current browser window. To change this, you must

specify another target for the link.  In the example above, we used the _blank attribute and it is to
open the link in a new tab.

The target attribute specifies where to open the linked document.

The target attribute can have one of the following values:

_self – Default. Opens the document in the same window/tab as it was clicked.

_blank – Opens the document in a new window or tab.

_parent – Opens the document in the parent frame.

_top – Opens the document in the full body of the window.

Images as a link
To use an image as a link, just put the <img> tag inside the <a> tag:

Example

<a href=”https://lab.thecloudde.com”>

<img src=”test.jpeg” alt=”testing this image as links”


style=”width:300px;height:200px;”>

</a>

Run Code

 Previous Next 



© 2022 CLOUDDE. All Rights Reserved

You might also like