<style>
ul li {
float: left;
height: 50px;
width: 120px;
color: white;

text-align: center;
margin-left: 5px;
list-style-type: none;
}
a{
color:white;
text-decoration:none;
}
.menu{
height: 50px;
background: #0094ff;
line-height: 50px;
}
.bgcolor {
background: red;
}

</style>

<script>

$(document).ready(function () {
$('.menu li a').each(function () {
if ($($(this))[0].href == String(window.location))
$(this).parent().addClass('bgcolor');
});
})
</script>

<div class="menu">
<ul style="list-style-type: none;">

<li><a href="/Test/Home" title="网站首页" class="home">首页</a></li>
<li><a href="/Test/A" title="测试导航">A测试导航</a></li>
<li><a href="/Test/B" title="测试导航">B测试导航</a></li>
<li><a href="/Test/C" title="测试导航">C测试导航</a></li>

</ul>
</div>

最新文章

  1. React的使用与JSX的转换
  2. .pop ----remove 删除
  3. 转 git安装配置
  4. MAC系统生成RSA公钥私钥
  5. Nico Nico Ni~(完全背包)
  6. Android应用开发基础之九:内容提供者(ContentProvider)
  7. (转)freemakeer初入门
  8. iOS适配(Masonry)
  9. 问题:贴友关于CSS效果的实现
  10. html 5的localstorag
  11. Binder的非正常消亡时的重置方法
  12. .net调用Outlook 批量发送邮件,可指定Outlook中的账号来发送邮件
  13. Linux入门(3)——Ubuntu16.04下安装VMware
  14. ubuntu server 16.04 安装过程中提示无法安装busybox-initramfs
  15. 华为交换机批量加入 Vlan 方法
  16. 解决秒杀活动高并发出现负库存(Redis)
  17. 第二章 使用unittest模块扩展功能测试
  18. angular-translate
  19. HTTP错误405
  20. SQLSERVER 免费对比数据库结构和数据的工具支持:SQL Server 2012, SQL Server 2008 and SQL Server 2005

热门文章

  1. sql内置函数pivot强大的行转列功能
  2. RESTful API Develop
  3. wcf契约随记
  4. 根据首尾字节的tcp分包断包算法
  5. 树莓派学习笔记 1 -- 硬件的需求以及raspbian系统的安装
  6. 关于使用 jBox 对话框的提交问题
  7. ASP.NET WebApi 入门
  8. GitHub 简易使用
  9. C#简单实现贪吃蛇程序(LinQ + Entity)
  10. oracle数据库对date字段类型存在空值进行排序的处理方法