A href target not working with iframe

I am trying to open a link on click on the image.

I am not sure, whats wrong in the code.

Below is my code and this is my site http://www.iradio.ie/

<a href="http://kevinegancars.ie/used-cars/cat/REDUCED-TO-CLEAR!!">
<iframe id ="person1" border="0" width="728" height="90" alt="" src="../kevin_cars/KEVIN%20CAR.jpg" frameborder="0"></iframe></a>

An iframe tag is essentially a different browser window. You are not clicking on your link, but inside a different window.

Thus being said, I see absolutely no reason for the iframe - it only loads a document containing an image. Use an img tag instead or place a meaningful text inside the a tag, hide it and put the image on the background.

3 Likes

thanks for replying.

I am kinda newbie. What you just suggested, can you please put it in code

Thanks again.

First solution is like this:

<a href="http://kevinegancars.ie/used-cars/cat/REDUCED-TO-CLEAR!!">
  <img src="../kevin_cars/KEVIN%20CAR.jpg">
</a>

For the image replacement method you could study this article on CSS Tricks - especially the “2012: Scott Kellum Method”

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.