How to make a body background image clickable!

Discussion in 'HTML & Website Design' started by blake3334, Jul 13, 2010.

  1. #1
    First one with the right code gets a cookie!!!:) ( must be cross browser )
     
    blake3334, Jul 13, 2010 IP
  2. Firejerm

    Firejerm Peon

    Messages:
    113
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Why would you do this??? also

    html:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <link rel="stylesheet" type="text/css" href="your.css" />
    </head>

    <body>
    <div id="back"><a href="whateversite.com"></a></div>
    <div id="wrap">
    <!--end wrap--></div>
    </body>
    </html>

    Css:
    html, body {
    font: 9pt/1.5 Verdana, Geneva, sans-serif;
    background: #000;
    color: #000;
    text-align: left;
    }
    * {
    margin: 0;
    padding: 0;
    border: 0;
    }
    #back {
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    }
    #back a:link {
    height: 100%;
    width: 100%;
    display: block;
    }
    #wrap {
    height: 600px;
    width: 960px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding: 15px;
    background: #4C4C4C url(http://www.SITEURL.com/SEPARATE-IMAGE-FROM-CLICKABLE-BODY-IMAGE.jpg) no-repeat fixed center center;
    border: 3px double #ccc;
    }
     
    Firejerm, Jul 14, 2010 IP