Your Ad Here

Posted By

indianocean on 06/06/07


Tagged

css javascript html


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

jonhenshaw
basicmagic


Image appearing as link calling a javascript function, without "href"


 / Published in: CSS
 

  • Put image in 'span' otherwise the whole surrounding box becomes a link.
  • Is there a better way to make images a link if you don't want a server roundtrip by?
  1. #container{
  2. float: right;
  3. padding-right: 50px;
  4. width: 25px;
  5. }
  6. #image{
  7. cursor: pointer;
  8. }
  9.  
  10.  
  11. Usage:
  12. <div>
  13. <span id="container">
  14. <img id="image" onclick="doit()" src="some.gif">
  15. </span>
  16. </div>

Report this snippet  

You need to login to post a comment.