Mythrillic
Mythrillic

Reputation: 417

linking background image

I have an css background-image that needs to be linked to the site index. However I cannot seem to be able to link it. I have tried using:

#header-bg {
    background-image: url("./styles/duffcraft/theme/images/bg_header.png");
}

Then using:

<a href="./" id="header-bg"></a>

But it didn't work. The url for the site is: http://bindmind.net/dev/ Its the image in the middle with the DuffCraft and etc on it. The file name for the image is header.png.

Basically it has to link to the site index but because ill be transferring this to another domain soon I can't have it linking to http://www.bindmind.net/dev/.

EDIT: I have managed to get it to link, but now there is a massive gap bewteen the image and the actual content. (fixed that.)

Upvotes: 0

Views: 100

Answers (2)

mliebelt
mliebelt

Reputation: 15525

You should use instead of a background image a read image in your HTML code. It should look like that:

<a href="/"> 
  <img src="./styles/duffcraft/theme/images/bg_header.png"/>
</a>

This should show your link as an image only, with the size of the image, and by clicking on the image, your index page will be shown.

Upvotes: 2

John
John

Reputation: 2501

you can do this:

<a href="http://bindmind.net/dev/"><div id="header-bg"></div></a>

or probably you can do it with JavaScript

Upvotes: 0

Related Questions