Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
149
rated 0 times [  153] [ 4]  / answers: 1 / hits: 27441  / 13 Years ago, thu, june 23, 2011, 12:00:00

How do I make this entire td a link?



<td id=blue-border><span id=blue></span></td>


Clicking td should make it behave like this (I know this is syntactically incorrect:



<a href=javascript:chooseStyle('blue-theme', 360)> <td id=blue-border><span id=blue></span></td> </a>


EDIT: so far all the suggestions are only making the span inside the td a link, help lol.


More From » html

 Answers
92

Use CSS.




td a { display: block; width: 100%; height: 100%; }

<table style=width: 100%>
<tr>
<td><a href=#>Link</a></td>
</tr>
</table>




The CSS forces the link to expand to the full width and height of the TD.


[#91533] Wednesday, June 22, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
josefinap

Total Points: 548
Total Questions: 125
Total Answers: 106

Location: Angola
Member since Tue, May 5, 2020
4 Years ago
;