Christopher R wrote:
> I was reading up on how to create links from background images, so I came 
> across this page
> which mentions the following:
> http://www.attackr.com/css-trick-turning-a-background-image-into-a-clickable-link/
> Simple enough one thought, I applied it like so to my code:
> 
> HTML:
> 
> <span id="logomiddle"><a href="www.cokecola.com"></a></span> /* coka cola is 
> just a test URL */
> 
> CSS:
> 
> #logomiddle {
>   display: block;
>   background: url(header-web-page-graphic-done3_01.png) no-repeat top center;
>   display: block;
>   position: absolute;
>   left: -490px;
>   top: -150px;
>   height: 1150px;
>   width: 960px;
>   z-index: 1;
> }
> 
> I added display: block as it mentions but there is some mentioning of 
> positioning that has gotten me lost.


Hello Christopher,

The linked example has this which is very different to what you have.

<div id="header"><a 
href="http://mysite.com";><span>MySite.com</span></a></div>

#header a {
   background: #fff url(images/header.png) no-repeat;
   display: block;
   height: 101px;
   width: 800px;
}
#header a span {
   visibility: hidden;
}


Maybe using such code will help.


<E id="ancestor-element"><a href="www.cokecola.com"><span>Text 
here</span></a></E>


with this CSS.

#ancestor-element a {
   display: block;
   background: url(header-web-page-graphic-done3_01.png) no-repeat top 
center;
   height: 1150px;
   width: 960px;
}
#ancestor-element a span {
   position: absolute;
   left: -490px;
   top: -150px;
}


And change the id to that of an ancestor element containing the anchor 
link to cokecola.


-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to