1

I have an icon navigation bar on my website. When the viewer clicks on the logo, they will be led to a different website. (If they click on the facebook logo, they will be led to facebook. If the click on the instagram logo they will be led to instagram.)

I have an email logo. When the viewer clicks on it, I want them to be led to their email application so that they can send an email. This is what I have tried:

<a href="myemailaddress@gmail.com"> <img src=images/navigation_icon/email.png"> </a>

Why is this not working?

Britney Forsyth
  • 31
  • 1
  • 2
  • 4

2 Answers2

7

You need to add mailto: as a prefix to the email address

<a href="mailto:myemailaddress@gmail.com"> <img src="images/navigation_icon/email.png"> </a>

This should work for you

Bear in mind that setting up an email address in this 'open' manner is not a recommended way of linking because of the risk of spam bots harvesting the address _

Read more about protecting the link here >>> Hide Email Address from Bots - Keep mailto:

Note also the comments below this answer_ because there was an error in your original code

inputforcolor
  • 909
  • 2
  • 15
  • 27
-1

this should work:

<a href='your link' target='_blank'>

      <i class='fa fa facebook'></i>
</i>
</a>
mtorreblanca
  • 371
  • 1
  • 4
  • 14