Hey guys, got a question for all you HTML wizards out there. I'm running Wordpress on one of my sites and I want to make the background (which is an image) clickable. Is this even possible? I can make the background any image I want, that seems easy enough (I just use "background: url(etc)" in the stylesheet for that), but I've been scouring the net for a way to make it clickable, too, but so far, no luck. Anyone got any ideas? I'm fresh out.
The way I see it, you can make it's container clickable. For example, if you want the body background to be clickable: In your HTML: <body onClick="javascipt: document.location = 'http://www.digitalpoint.com'"> You add some styling so people will be aware that it is clickable: In your CSS: body {cursor: hand; cursor: pointer} The clickable area equals the size of the container, in this case is the whole page. Of course, you can apply this to a div.
yeah better using a div rather than body bcos the full page when ever clicked will direct you to the image, which isn't what I think you want lol...
Nope, if use on the body when click it will direct to the onClick's URL. And, most importantly, any link on the page will still work since those will be on top (considering that body is the "lowest" object).