HTML TD可点击 [英] HTML TD Clickable
本文介绍了HTML TD可点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个菜单,您可以在右上角看到 - www.balibar.co
I have a menu you can see on the top right hand side - www.balibar.co
HTML:
<div id="joinHeader" class="shadow">
<table id="indexNavigation"><tr>
<td><a id="navSearch">Search</a></td>
<td><a id="navLanguages">Languages</a></td>
<td id="activeNavLink"><a id="navLogin">Login</a></td>
</tr></table>
</div>
CSS:
table#indexNavigation {
width: 100%;
height: 25px;
font-weight: normal;
font-size: 1.1em;
border-collapse: collapse;
}
table#indexNavigation td {
text-align: center;
color: white;
width: 33.33%;
border-right: 1px solid #FFF;
cursor: pointer;
}
table#indexNavigation td#activeNavLink {
border-right: none;
}
我想让整个TD Clickable。
我添加了cursor:pointer;到TD,但它不亮起,除非在字。
我尝试把外面的,但这没有工作。
I want to make the entire TD Clickable. I've added cursor: pointer; to the TD but it doesn't light up except when over the words. I tried putting the outside the but this didn't work.
有一个技巧,使这个可点击。
然后将它挂接到jquery一个点击事件 - 例如:
Is there a trick to make this clickable. Will then hook this up to jquery for a click event - eg:
$('td#activeNavLink').click(function() {
thx
推荐答案
您应该在CSS中使用 display:block
。
You should use a display:block
in your CSS.
以下是来自具有块链接的无序列表(ul)的示例:链接
Here's an example from an unordered list (ul) with block-links: link
这篇关于HTML TD可点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文