PDA

View Full Version : Linking a Background Image


Rue88
11-15-2011, 11:54 PM
Hi,

Newbie here...I have a background image set on my site but need to make it link to my home page. Can someone tell me how to do that?
http://www.alkiesliquors.com

I should mention I did the site using templates.

Thanks!
Rue

edbr
11-16-2011, 12:13 AM
what you could do is add a layer over the area you want to link, add a transparent image and link that

Rue88
11-16-2011, 01:05 AM
Okay, how would I do that?

domedia
11-16-2011, 01:18 AM
You cannot make background images links. Put something on top of the background and link it. If you put something in the background that needs to be a link, take it out of there.

DWcourse
11-16-2011, 02:34 AM
I believe this should do it without an image Place the link in the div that holds the background image.

<a class="invisiblelink" href="http://www.something.com">&nbsp;</a>

With this CSS. Modify the height and width to suit your needs.

.invisiblelink {
text-decoration: none;
display: block;
height: 100px;
width: 300px;
}

domedia
11-16-2011, 04:04 AM
Just to help elaborate on the solution:

For SEO, add the actual name of the link, instead of '&nbsp;' and hide that text in your CSS with a negative text-indent.

<a class="invisiblelink" href="http://www.something.com">About Us</a>

.invisiblelink {
text-indent: -9000px;
text-decoration: none;
display: block;
height: 100px;
width: 300px;
}

Rue88
11-17-2011, 04:26 PM
Thank you! I was able to put an invisible image over the area and link to it.