博客列表 >分类菜单啊

分类菜单啊

南鸢离梦的博客
南鸢离梦的博客原创
2019年11月14日 08:50:17622浏览
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>分类菜单</title>
  6. <style type="text/css">
  7. * {
  8. margin: 0;
  9. padding: 0;
  10. }
  11. body {
  12. font:14px/1.5 "宋体";
  13. }
  14. a {
  15. text-decoration: none;
  16. }
  17. a:hover {
  18. color: red;
  19. }
  20. ul {
  21. position: relative;
  22. margin: 50px 0 0 50px;
  23. width: 300px;
  24. border: 2px solid #aa9900;
  25. }
  26. li {
  27. height: 30px;
  28. line-height: 30px;
  29. width: 100%;
  30. text-indent: 1em;
  31. list-style: none;
  32. border-top: 1px solid #CCC;
  33. }
  34. li:hover,
  35. li:hover + li,
  36. li:first-child {
  37. border-top: none;
  38. height: 31px;
  39. line-height: 31px;
  40. }
  41. div.box {
  42. width: 300px;
  43. height: calc(100% + 2px);
  44. display: none;
  45. left: 300px;
  46. top: -2px;
  47. border: 1px solid #999;
  48. position: absolute;
  49. z-index: 1;
  50. background: #EEE;
  51. }
  52. div.item {
  53. position: relative;
  54. width: 100%;
  55. height: 100%;
  56. }
  57. li:hover div.box {
  58. display: block;
  59. }
  60. li div.item span.link {
  61. display: block;
  62. width: calc(100% - 1px);
  63. height: calc(100% - 2px);
  64. position: absolute;
  65. left: 0;
  66. top: 0;
  67. border-style: solid;
  68. border-color: #FFF;
  69. border-width: 1px 0 1px 1px;
  70. z-index: 2;
  71. }
  72. li:hover div.item span.link {
  73. border-color: #999;
  74. background: #EEE;
  75. width: 100%;
  76. }
  77. span.icon {
  78. position: absolute;
  79. right: 10px;
  80. top: 0;
  81. color: #999;
  82. font-weight: bold;
  83. font-family: serif;
  84. }
  85. li:hover a {
  86. color: #270;
  87. }
  88. </style>
  89. </head>
  90. <body>
  91. <ul>
  92. <li>
  93. <div class="item">
  94. <span class="link">
  95. <a href="#">分类1</a>
  96. </span>
  97. <span class="icon">&gt;</span>
  98. </div>
  99. <div class="box">分类1 详细信息</div>
  100. </li>
  101. <li>
  102. <div class="item">
  103. <span class="link">
  104. <a href="#">分类2</a>
  105. </span>
  106. <span class="icon">&gt;</span>
  107. </div>
  108. <div class="box">分类2 详细信息</div>
  109. </li>
  110. <li>
  111. <div class="item">
  112. <span class="link">
  113. <a href="#">分类3</a>
  114. </span>
  115. <span class="icon">&gt;</span>
  116. </div>
  117. <div class="box">分类3 详细信息</div>
  118. </li>
  119. <li>
  120. <div class="item">
  121. <span class="link">
  122. <a href="#">分类4</a>
  123. </span>
  124. <span class="icon">&gt;</span>
  125. </div>
  126. <div class="box">分类4 详细信息</div>
  127. </li>
  128. <li>
  129. <div class="item">
  130. <span class="link">
  131. <a href="#">分类5</a>
  132. </span>
  133. <span class="icon">&gt;</span>
  134. </div>
  135. <div class="box">分类5 详细信息</div>
  136. </li>
  137. <li>
  138. <div class="item">
  139. <span class="link">
  140. <a href="#">分类6</a>
  141. </span>
  142. <span class="icon">&gt;</span>
  143. </div>
  144. <div class="box">分类6 详细信息</div>
  145. </li>
  146. <li>
  147. <div class="item">
  148. <span class="link">
  149. <a href="#">分类7</a>
  150. </span>
  151. <span class="icon">&gt;</span>
  152. </div>
  153. <div class="box">分类7 详细信息</div>
  154. </li>
  155. <li>
  156. <div class="item">
  157. <span class="link">
  158. <a href="#">分类8</a>
  159. </span>
  160. <span class="icon">&gt;</span>
  161. </div>
  162. <div class="box">分类8 详细信息</div>
  163. </li>
  164. <li>
  165. <div class="item">
  166. <span class="link">
  167. <a href="#">分类9</a>
  168. </span>
  169. <span class="icon">&gt;</span>
  170. </div>
  171. <div class="box">分类9 详细信息</div>
  172. </li>
  173. </ul>
  174. </body>
  175. </html>
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议