Blogger Information
Blog 16
fans 0
comment 0
visits 9638
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
第三课-盒子模型-导航栏
坨坨
Original
512 people have browsed it

  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>盒子模型-导航栏</title>
  7. <style>
  8. ul,li,body{
  9. padding: 0;
  10. margin: 0;
  11. box-sizing: border-box;
  12. }
  13. a{
  14. text-decoration: none;
  15. color: #666;
  16. display: inline-block;
  17. text-align: center;
  18. padding: 20px 40px;
  19. width: 100px;
  20. }
  21. li{
  22. list-style: none;
  23. }
  24. nav>ul{
  25. background: rgb(241, 224, 224);
  26. display: flex;
  27. justify-content: center;
  28. position: relative;
  29. }
  30. nav>ul>li:hover{
  31. background: rgb(236, 135, 135);
  32. }
  33. nav>ul>li>ul>li:hover{
  34. background: rgb(236, 135, 135);
  35. }
  36. nav>ul>li:hover>ul{
  37. display: block;
  38. }
  39. nav>ul>li>ul{
  40. background: rgb(241, 224, 224);
  41. position: absolute;
  42. display: none;
  43. }
  44. </style>
  45. </head>
  46. <body>
  47. <nav>
  48. <ul>
  49. <li><a href="">首页</a></li>
  50. <li><a href="">前端学习</a>
  51. <ul>
  52. <li><a href="">html</a></li>
  53. <li><a href="">css</a></li>
  54. <li><a href="">javascript</a></li>
  55. </ul>
  56. </li>
  57. <li><a href="">后端学习</a>
  58. <li><a href="">我的</a>
  59. <ul>
  60. <li><a href="">资料修改</a></li>
  61. <li><a href="">退出登录</a></li>
  62. </ul>
  63. </li>
  64. </ul>
  65. </nav>
  66. </body>
  67. </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