EY Posted March 21, 2008 Share Posted March 21, 2008 I have this piece of code that calls my logo out: <td width="35%"><img src="/images/header1/travel_header_r1_c1.jpg" width="306" height="99" /></td> How can i make it that when clicked it takes people to the index page? Quote Link to comment https://forums.phpfreaks.com/topic/97180-turning-image-into-link/ Share on other sites More sharing options...
LemonInflux Posted March 21, 2008 Share Posted March 21, 2008 This isn't CSS. <td width="35%"><a href="HomepageLink"><img src="/images/header1/travel_header_r1_c1.jpg" width="306" height="99" /></a></td> Change HomepageLink to whatever your homepage url is Quote Link to comment https://forums.phpfreaks.com/topic/97180-turning-image-into-link/#findComment-497394 Share on other sites More sharing options...
haku Posted March 21, 2008 Share Posted March 21, 2008 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> Quote Link to comment https://forums.phpfreaks.com/topic/97180-turning-image-into-link/#findComment-497407 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.