Creating a link for a div
I have a logo in a div and would like to have it link to a home page on click. From my quick search it looks like this could easily be done with css stylesheets. Any other quic开发者_开发问答k way to do it with javascript or jquery or something??
You can't do this with CSS. You need to use actual markup for the link, and using Javascript with onClick and window.location would just be stupid.
<a href="http://www.myhomepage.com" title="CLick to go to Home">
<img src="/images/logo.png" height=64 width=32 alt="logo" />
</a>
just wrap the image file in an anchor tag? If you are not using an image tag to display the logo, you can use javascript/jquery to leverage the click event of the div to navigate to the link.
Use this:
onClick="parent.location='page.html'
精彩评论