top of page

HTML Links - Hyperlinks

HTML links are hyperlinks.

You can click on a link and jump to another page or web address or files from the current page.


<a href="url">Visible text</a>

<a href="">Visit us!</a>

Use target="_blank" to open the linked document in a new browser window or tab:

<a href=""  target="_blank">Visit us!</a>

 Image as a Link

To use image as link we just need insert this  <img> tag inside the <a> tag:

<a href="">
<img src="logo.png" alt="Image link" style="width:30px;height:30px;">

In the above example alt="image link" refers to the text or alternative to the image in case the image is not visible to the browser.

to an Email Address

Use mailto: inside the href attribute to create a link that opens the user's email

<a href="">Send email</a>

Link Titles

The title attribute specifies extra information about the element or link. This will be visible as tooltip text.

Example:<a href="" title="Go to elogic website">Visit us/a>

HTML Link Colors

We can change the style of html link by using CSS properties here we are changing the color of link in different occasion that is when it get visited, active and hover.

Example:<!DOCTYPE html>
a:link {
  color: green;
  background-color: transparent;
  text-decoration: none;
a:visited {
  color: yellow;
  background-color: transparent;
  text-decoration: none;
a:hover {
  color: red;
  background-color: transparent;
  text-decoration: none;
a:active {
  color: brown;
  background-color: transparent;
  text-decoration: underline;

<h2>Link Colors</h2>

<p>You can change the default colors of links</p>

<a href="" target="_blank">visit us</a> 


bottom of page