SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2010
    0 Post(s)
    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...

    #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...

    <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!


  2. #2
    SitePoint Mentor bronze trophy
    ronpat's Avatar
    Join Date
    Jun 2012
    NJ, USA
    65 Post(s)
    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.


Tags for this Thread


Posting Permissions

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