最好的方式代码stackoverflow风格的'问题'/'标签'翻转按钮 [英] Best way to code stackoverflow style 'questions' / 'tags' rollover buttons
问题描述
实际上,Stackoverflow的最佳实现方式是'Questions','Tags','Users'实现方式如下:
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>
因为所有的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.
我发现stackoverflow使用< li>
非常有趣, $ c>< span> 。好奇为什么...
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需要。只需使用:hover 伪类: / p>
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.
这篇关于最好的方式代码stackoverflow风格的'问题'/'标签'翻转按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!