Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to attach url link to an image?

I am creating an website. It contains videos of different places. Now my problem is i need integrate an image on that with url link. when user taps on that link it has to go to that link. Even user downloads the video also it has to go to that link (same link above linked to image).

like image 334
Zach Avatar asked Dec 17 '09 13:12

Zach


People also ask

How do I make a URL image clickable?

To use image as a link in HTML, use the <img> tag as well as the <a> tag with the href attribute. The <img> tag is for using an image in a web page and the <a> tag is for adding a link. Under the image tag src attribute, add the URL of the image.


2 Answers

"How to attach url link to an image?"

You do it like this:

<a href="http://www.google.com"><img src="http://www.google.com/intl/en_ALL/images/logo.gif"/></a>

See it in action.

like image 97
Gregory Pakosz Avatar answered Sep 18 '22 17:09

Gregory Pakosz


Alternatively,

<style type="text/css">
#example {
    display: block;
    width: 30px;
    height: 10px;
    background: url(../images/example.png) no-repeat;
    text-indent: -9999px;
}
</style>

<a href="http://www.example.com" id="example">See an example!</a>

More wordy, but it may benefit SEO, and it will look like nice simple text with CSS disabled.

like image 20
alex Avatar answered Sep 16 '22 17:09

alex