Blogger Information
Blog 2
fans 0
comment 0
visits 728
Related recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
带二级分类的导航
蒲公英
Original
366 people have browsed it

带二级分类的导航

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>导航-二级分类</title>
  6. <style>
  7. body,ul,li{
  8. padding: 0px;
  9. margin: 0px;
  10. }
  11. li{
  12. list-style: none;
  13. }
  14. a{
  15. text-decoration: none;
  16. color: white;
  17. }
  18. nav,nav>ul{
  19. /*border:1px solid red;*/
  20. background: blue;
  21. /* width: 1200px; 指定宽度*/
  22. /* margin: 10px auto;*/
  23. }
  24. nav>ul{
  25. /*border:1px solid #000000;*/
  26. display: flex;
  27. justify-content: center; <!--对齐-->
  28. }
  29. nav>ul>li{
  30. position: relative;
  31. padding: 10px 20px;
  32. width: 100px;
  33. }
  34. nav>ul>li:hover,nav>ul>li>ul>li:hover {
  35. background: #a31515;
  36. }
  37. nav>ul>li>ul{
  38. position: absolute;
  39. /*border:1px solid #000;*/
  40. background: red;
  41. left:0px;
  42. top:40px;
  43. display: none;
  44. width: 140px
  45. }
  46. nav>ul>li>ul>li{
  47. padding: 10px 20px;
  48. }
  49. nav>ul>li:hover>ul{
  50. display: block;
  51. }
  52. </style>
  53. </head>
  54. <body>
  55. <!--导航区域-->
  56. <nav>
  57. <ul>
  58. <li><a href="">首页</a></li>
  59. <li>
  60. <a href="">图书</a>
  61. <ul>
  62. <li><a href="">小学</a></li>
  63. <li><a href="">中学</a></li>
  64. <li><a href="">其他</a></li>
  65. </ul>
  66. </li>
  67. <li>
  68. <a href="">服饰</a>
  69. <ul>
  70. <li><a href="">童装</a></li>
  71. <li><a href="">女装</a></li>
  72. <li><a href="">男装</a></li>
  73. </ul>
  74. </li>
  75. <li><a href="">家居</a>
  76. <ul>
  77. <li><a href="">客厅用</a></li>
  78. <li><a href="">房间用</a></li>
  79. <li><a href="">其他</a></li>
  80. </ul>
  81. </li>
  82. <li>
  83. <a href="">珠宝饰品</a>
  84. <ul>
  85. <li><a href="">黄金珠宝</a></li>
  86. <li><a href="">流行饰品</a></li>
  87. <li><a href="">流行饰品</a></li>
  88. <li><a href="">礼品</a></li>
  89. </ul>
  90. </li>
  91. </ul>
  92. </nav>
  93. </body>
  94. </html>
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post