SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2010
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help needed making background image a clickable link

    Hi guys,

    I want to make the background of my site an advertising background where the background image is clickable.

    I've tried a few tutorials but none seem to be working

    What I've got is this as my CSS...

    Code:
    #skin {position: absolute;
    	width: 100%;
    	height: 800px;
    	margin-left: auto;
    	margin-right: auto;
    	top: 0px;
    	left: 0px;
    	z-index: -1;
    	background-position: fixed;
    }
    ...and this as my HTML...

    Code:
    <div id="skin"><a href=""><img src="background.jpg" /></a></div>
    It kind of works but the link is only a thin strip either side of the screen for some reason and doesn't span the whole image background.

    Does anyone have any ideas as to where I'm going wrong?

    Thank you very much and hope to hear from you!

    SM

  2. #2
    SitePoint Mentor bronze trophy
    ronpat's Avatar
    Join Date
    Jun 2012
    Location
    NJ, USA
    Posts
    2,533
    Mentioned
    62 Post(s)
    Tagged
    2 Thread(s)
    For starters, you are not describing the issue very well. Your post talks about a background image, yet the HTML shows a foreground image of unknown dimensions. It would be helpful if you would follow the link at the bottom of my post and read the posting guidelines. They suggest that you post a simple but complete working example that demonstrates the problem.

    A background image cannot be clickable; however, it's (foreground) container can be.

    We need a better description of the issue to offer useful help.

    Cheers


Tags for this Thread

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
  •