views:

36

answers:

3

I need to place an advertisement as a background image of my webpage. What's the best way to make the body background image a clickable link?

A: 

Do something like this. Easy

<a href="yourlink.html" style="width:50px;height:50px;display:block;background:url(image.jpeg);">Text If you want</a>
Starx
+1  A: 

You can't make a background image clickable. Is your image taking the whole body space ?

Kaaviar
The background image is shown on the left and right columns either side of the page content. This is the part that needs to be clickable
Maris solution should work then.
Kaaviar
+1  A: 

Or you can you use javascript:

$("body").click(function(event){ 
    event.stopPropagation(); 
    alert('oh hai');
});
Māris Kiseļovs