Make a div / div tag a hyperlink or link

This tip is very helpful with today’s web where a lot of the graphic stuff such as drop shadows and gradients are being done through CSS.

<div onclick="location.href='newurl.html';">&nbsp;</div>

New Window:

<div onclick="'newurl.html','mywindow');" style="cursor: pointer;">&nbsp;</div>


I hope this helps someone else out there….



Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.