Some problems with my code. Here's an updated working one.
First the CSS
Code:
body { background-image: url(http://www.mywebsite.com/images/main-image.jpg); background-repeat: no-repeat; background-position: center top}
^ Sets the Background of the page ^
Code:
.transp {position:absolute;left:0px;top:0px;z-index:1;
background-color:transparent;width:100%;height:100%; cursor:pointer;}
^ The transparent div. 'z-index:1' is IMPORTANT if you want only the background to link. ^
Code:
#content {position:absolute; z-index:2}
^ A basic div for your page, i've only set two parts two it, of course you may add to it, but DO NOT remove the two parts or else it will make the whole page a link. You may edit the z-index, but it must stay at least 2. ^
Now the HTML
The following codes would be in between the <body> tags
Code:
<div class="transp" onclick="location.href = 'http://yoursite.com';" ></div>
^ Makes it a proper link this time. Make sure you end the div tag before you open another one^
Code:
<div id="content">Some content</div>
^ Some content, this will overlap the background thus not be a link ^
Last edited by Gilligan : 02-16-2008 at 06:34 PM.
|