Jump to content

Turning image into link


EY

Recommended Posts

It could be CSS, and I actually prefer to do it with CSS as its easier to add a rollover if you do:

 

<style type="text/css>
.link
{
   background: url(path/to/image.jpg);
   width: __px; (width of image)
   height: __px; (height of image)
   display: block;
   text-indent: -9999px;
}

// add the following to add a rollover to the link
.link:hover
{
   background: url(path/to/rollover-image.jpg);
}
</style>

 

And the HTML:

<a href="url.html" class=".link">Text to be displaced by the text indent in the css</a>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.