在IE 6,7&中,桌子周围的锚标签不可点击。 8 [英] Anchor tag around table is not clickable in IE 6, 7 & 8
本文介绍了在IE 6,7&中,桌子周围的锚标签不可点击。 8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问题:当围绕一个带有锚标签的桌子时,表格及其中的所有内容都无法在IE 6,7& 8.如果我不能用div替换表,我该如何解决这个问题呢?
The problem: when surrounding a table with an anchor tag, the table and everything within is not clickable in IE 6, 7 & 8. How do I solve this issue assuming I can't replace the table with divs?
示例代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
<head>
<title>Test</title>
</head>
<body>
<a href="http://www.google.com">
<table height="35">
<tr>
<td>I'm a link in a table, bet you can'tclick me!</td>
</tr>
</table>
</a>
</body>
</html>
推荐答案
您可以在表格上添加JavaScript onclick事件处理程序,以执行与链接相同的操作。
You can add a JavaScript onclick event handler on the table to do the same thing as the link.
编辑:删除了初始建议它在其他浏览器中表现不佳。
Removed initial suggestion since it behaved badly in other browsers.
这篇关于在IE 6,7&中,桌子周围的锚标签不可点击。 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文