DataGuy
DataGuy

Reputation: 1725

Links inside of div or span not working?

I have a simple div with three images in it and Im trying to make all three images separate html links

Am I missing something? This seems too easy, but it surely doesn't work:

<div><a href="#"><img src="img/dboarddown.png"></a><img src="img/ranking.png"><img src="img/analytics.png"></div>

span doesnt work either....I dont get the pointer and nothing is click-able.

Upvotes: 0

Views: 941

Answers (3)

Sjoerd de Wit
Sjoerd de Wit

Reputation: 2413

this should work just fine

<div>
 <a href="#link1">
  <img src="img/dboarddown.png"/>
 </a>
 <a href="#link2">
  <img src="img/ranking.png"/>
 </a>
 <a href="#link3">
  <img src="img/analytics.png"/>
 </a>
</div>

Upvotes: 1

caramba
caramba

Reputation: 22480

you only got one link:

<div>
    <a href="#"><img src="img/dboarddown.png"></a>
    <img src="img/ranking.png">
    <img src="img/analytics.png">
</div>

replace to:

<div>
    <a href="#"><img src="img/dboarddown.png" alt="" /></a>
    <a href="http://stackoverflow.com"><img src="img/ranking.png" alt="" /></a>
    <a href="http://google.com"><img src="img/analytics.png" alt="" /></a>
</div>

Upvotes: 0

Jaroslav Kubacek
Jaroslav Kubacek

Reputation: 1447

<div><a href="#"><img src="img/dboarddown.png"/></a>
    <a href="#"> <img src="img/ranking.png"/></a>
    <a href="#"><img src="img/analytics.png"/></a></div>

Last two images are not wrapped in to tag and don't forget to close img tag.

Upvotes: 0

Related Questions