码迷,mamicode.com
首页 > Web开发 > 详细

css 导航栏

时间:2015-04-28 17:55:29      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>导航栏</title>
  6. <link rel="stylesheet" type="text/css" href="../css/reset.css"/>
  7. <style type="text/css">
  8. .nav{
  9. width: 100%;
  10. height: 40px;
  11. background: #000000;
  12. line-height: 20px;
  13. text-align: center;
  14. }
  15. .nav ul{
  16. display: inline-block;
  17. }
  18. .nav ul li{
  19. display: inline-block;
  20. width: 60px;
  21. padding:10px;
  22. text-align: center;
  23. color: #fff;
  24. }
  25. .nav ul li a{
  26. color: #fff;
  27. }
  28. /**
  29. * first-child 获得第一个元素
  30. * IE6、IE7不支持 first-child 属性
  31. * */
  32. .nav ul li:first-child{
  33. background: dodgerblue;
  34. }
  35. .nav ul li:hover{
  36. background: dodgerblue;
  37. }
  38. </style>
  39. </head>
  40. <body>
  41. <nav class="nav">
  42. <ul>
  43. <li><a href="">home</a></li><li><a href="">home</a></li><li><a href="">home</a></li><li><a href="">home</a></li><li><a href="">home</a></li>
  44. </ul>
  45. </nav>
  46. </body>
  47. </html>

css 导航栏

标签:

原文地址:http://www.cnblogs.com/jalja/p/4463228.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!