最好的办法code计算器风格'问题'/'标签'过渡按钮 [英] Best way to code stackoverflow style 'questions' / 'tags' rollover buttons
问题描述
请告诉我实现翻转按钮像#2的最佳方式有'问题','标签','用户'在上面。
Whats the best way to implement rollover 'buttons' like Stackoverflow has for 'Questions', 'Tags', 'Users' at the top.
它实际上是这样实现的:
It is actually implemented like this :
<div class="nav">
<ul class="primarynav">
<li class="">
<a href="/questions">Questions</a>
</li>
<li class="">
<a href="/tags">Tags</a>
</li>
<li class="">
<a href="/users">Users</a>
</li>
<li class="">
<a href="/badges">Badges</a>
</li>
<li class="">
<a href="/unanswered">Unanswered</a>
</li>
</ul>
我有点放弃了试图找到这个JavaScript的,因为所有的javsascript似乎是在一行。
I kinda gave up trying to find the javascript for this since all the javsascript seems to be on one line.
我只是想知道什么人认为是实现这样简单的按钮最简单/最可靠的方法。
I was just wondering what people think is the simplest / most reliable way to implement simple buttons like this.
我觉得非常有趣的是计算器使用&LT;李&GT;
,而不是像&LT;跨度&GT;
。好奇,为什么...
I found it very interesting that stackoverflow is using <li>
and not something like <span>
. Curious as to why...
PS。我使用ASP.NET - 目前没有其他库,如JQuery的,但愿意尝试类似的东西,如果它会帮助
PS. I'm using ASP.NET -- currently with no other libraries such as JQuery, but willing to try something like that if it'll help.
推荐答案
有没有需要在链路上悬停效果的JavaScript。只需使用:悬停伪类:
There's no javascript needed for hover effects on links. Just use the :hover pseudo-class:
a:hover {
background-color:#FF9900;
}
对于菜单,这是很常见的使用无序列表来实现导航。
Regarding the menu, it is quite common to implement navigation using unordered lists.
这篇关于最好的办法code计算器风格'问题'/'标签'过渡按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!