link to an image to be redirected to another site

Asked

Viewed 76,351 times

3

so I have an image, I wanted that when clicking on this image the user was redirected to the link I defined,

<a href="www.google.com"><img src="img/css3.png" class="media-object  img-responsive img-thumbnail"></a>

however when I click on the image appears page not found

  • missing http:// on link

2 answers

6

The parameter href tag to accepts both relative and absolute links.

The way it was put in your example, it is understood the link as relative, soon it will reset the user to:

www.seusite.com/suapagina/www.google.com

To make the link absolute you must use // at first, this is:

<a href="//www.google.com"><img src="img/css3.png" class="media-object  img-responsive img-thumbnail"></a>

More information on documentation.

5


within your href= place http://www..... or just //www....

  • our dear brigade was pulling hair already, simple detail and I kill myself here to solve it thank you

  • For nothing @Fernandoalcantara, don’t forget to mark as correct answer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.