probably not the best way but instead of having the silver as a background why not just have it as a picture? that way you can just make the image a link
yeah your probably right i shouldnt be using those old tags... But it works for now and Im fine with it. One day when I get time I will update on the way I code
Use some Javascript. Here's a 'navToLink' function that would suit you nicely, I think. It will direct the user to the location contained in the first link of the cell.
/**
* Navigate to the first link contained with the object
* @param object The object that contains the link
* @return true
*/
function navToLink(obj)
{
if(obj && obj.getElementsByTagName)
{
var sublinks = obj.getElementsByTagName('a');
if(sublinks[0])
{
window.location = sublinks[0].href;
}
}
return true;
}
I'd change your code to something like:
[html]<td style="background-image:url(/images/img_06.gif); font-weight:bold; height:30px; width:144px; text-align:center;" onclick="navToLink(this)">
<a href="/tutorials" class="mainmenu">Tutorials</a>
</td>[/html]
Use CSS for all of it. Or better yet, put your style info into your stylesheet and give the td a class name so you dont have to apply a classname to any links within the cell (you can just specify to style all links that are under the cell).
Comments
The Royal Ram
you cannot do <a href="link">background="/images/img_06.gif"</a>
that simply wouldnt work , lol
Unless you meant another way?
The Royal Ram
How about:
Your current code:
Eddited code:
BTW: You shouldn't be using <b> or <font> anymore. And I think the same might apply to the align attribute too.
The Royal Ram
I'd change your code to something like:
[html]<td style="background-image:url(/images/img_06.gif); font-weight:bold; height:30px; width:144px; text-align:center;" onclick="navToLink(this)">
<a href="/tutorials" class="mainmenu">Tutorials</a>
</td>[/html]
Use CSS for all of it. Or better yet, put your style info into your stylesheet and give the td a class name so you dont have to apply a classname to any links within the cell (you can just specify to style all links that are under the cell).
ie: [html]<td class="navcell" onclick="navToLink(this)"><a href="/tutorials">Tutorials</a></td>[/html]
Webmaster-Talk.com
Chroder.com