如何使整个td链接? [英] How to make entire td a link?

查看:120
本文介绍了如何使整个td链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使整个td链接?

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

点击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>


推荐答案

p>使用CSS。

<style type="text/css">
td a { display: block; width: 100%; height: 100%; }
</style>

<td><a href="#">Link</a></td>

CSS强制链接展开到TD的全宽和高度。

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

这篇关于如何使整个td链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆