Forum Moderators: not2easy
----
td.link {
height: 22px;
}
td.link a {
display: block;
height: 22px;
text-decoration: none;
color: #000000;
}
td.link a:hover {
background: #339900;
}
----
Thanks.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<title></title>
<style type="text/css">
td.link {
[b]height:60px;[/b]
}
td.link a {
display: block;
[b]height:20px;
padding:20px 0;[/b]
text-decoration: none;
color: #000000;
}
td.link a:hover {
background: #339900;
}
</style>
<table border="1" width="50%">
<tr>
<td class="link"><a href="/">text</a></td>
<td>text</td>
</tr>
</table> I'm still not sure why the link text sticks to the top, though.
that doesnt really solve my problem because the cell needs to be 22px high?
It does if you're using a fixed pixel size for your text: for example, if you are using 12px text, then your line-height can be 12px too, and your top and bottom padding would be 5px each.
I only made it 60 pixels to better demonstrate the effect on the test page - all you have to do is adjust to your situation.
Just one thing tho, the background of the cell doesnt roll over when the cursor is there .. the cell rolls over only if the text is selected. Is there a way to make it more like this:
<td onmouseover="this.style.backgroundColor='#339900'" style="CURSOR: hand" onclick="window.location='index.html'" onmouseout="this.style.backgroundColor='#003366'"><a href="index.html">HOME</a></td>