SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    div header clickable

    hi,

    i have this:

    <div id="header"></div>

    that has an image as background...
    i'd like to have the image clickable...
    how to do it?

    thanks

  2. #2
    The I's for intelligent silver trophy iTechno's Avatar
    Join Date
    Jan 2006
    Location
    Yorkshire, UK
    Posts
    1,796
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it is a logo it shouldn't really be a BG, I don't think you can give a div a link though...

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it's a header

  4. #4
    Non-Member
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    4,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello


    something like this ?
    Code:
    <!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" xml:lang="en" lang="en">
    <head>
    <title>12345 12345 12345 12345 12345</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    	<style type="text/css">
    	#header{background:#ff6600;}
    	#header a{display:block;height:150px;text-indent:-2000px;text-decoration:none;}
    	</style>
    </head>
    <body>
    
    <div id="header"><h1><a href="x.htm">klick me</a></h1></div>
    
    </body>
    </html>

  5. #5
    The I's for intelligent silver trophy iTechno's Avatar
    Join Date
    Jan 2006
    Location
    Yorkshire, UK
    Posts
    1,796
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by liny
    it's a header
    Exactly, it shouldnt' be a bg.

  6. #6
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by iTechno
    Exactly, it shouldnt' be a bg.
    <div id="header" onclick="location.href='http://www.site.com';" style="cursor: pointer;">
    </div>

    the above is the code taken from a word press blog....
    I tried to use the same into my header but it doesn't get clickable..why?

  7. #7
    doing my best to help c2uk's Avatar
    Join Date
    May 2005
    Location
    Cardiff
    Posts
    1,832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Terrible code, I wouldn't use it and do what the others recommended.
    Dan G
    Marketing Strategist & Consultant

  8. #8
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    solved thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •