SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Taunton, UK
    Posts
    787
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to make div with background image a link

    Hi there

    I am displaying the header of a site which includes the logo by setting the background of a div to an image.

    http://www.lambandflag.co.uk

    However I would like to make the header a link so that when clicked on, it will take the user back to the home page.

    Not sure how to do this so any help would be appreciated.

    Thanks

    Paul

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,287
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Try this:
    Code:
    #header h1 a {display:block;width:100%;height:100%;}
    Don't put spaces in your classes as it may confuse some browsers.

    e.g.
    Code:
     <div id=" topnav">
    should be:
    Code:
     <div id="topnav">
    Paul

  3. #3
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Taunton, UK
    Posts
    787
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wicked thanks - that done the job just perfectly.

    Thank you

    Paul

  4. #4
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Taunton, UK
    Posts
    787
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Eep I have noticed a problem with Firefox and Netscape in that there is a blue line now across the header

    http://www.lambandflag.co.uk/

    Any ideas how to fix this?

    Thanks

    Paul

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,287
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Try this:
    Code:
    #header h1 a {display:block;width:100%;height:100%;text-decoration:none;}
    
    Paul


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
  •