Search code examples
csshtmlhrefxhtml-transitional

Divs make links on image unclickable


I am trying to position a Twitter and Facebook image next to my portrait on my website but in order to get the positioning correct i have to use divs. The problem is that when i add a div to the image and a link to it the div makes the image unable to be clicked and go to the link. I can't get rid of the divs because its the only way for my images to be positioned correctly. I will post a JSfiddle below with the code.

JSFiddle: http://jsfiddle.net/HeyItsProdigy/RVUhV/

Area of issue : <div id="facebook"><a href="http://www.facebook.com"><img src="fb.png" height="101" width="101" /></a>


Solution

  • The problem isn't exactly as you describe. The issue is that your positioning is causing your Twitter element to overlap the others, which makes them un-clickable.

    There's unfortunately not an easy solution. I think you're going to have to rethink your whole CSS structure, including eliminating the deprecated <center> tags to figure this one out. Good luck.