综合练习题5.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. <style>
  8. .drow-content{
  9. width: 300px;
  10. }
  11. button{
  12. width: 200px;
  13. height: 100px;
  14. background-color: #4caf51;
  15. border:0;
  16. font-size: 20px;
  17. color: #fff;
  18. font-weight: bold;
  19. }
  20. .drow-menu{
  21. width: 300px;
  22. box-shadow: 0 10px 10px rgba(0, 0, 0, 0.5);
  23. display: none;
  24. }
  25. .drow-item{
  26. height: 50px;
  27. padding: 10px;
  28. line-height: 50px;
  29. background-color: #fff;
  30. }
  31. .drow-item:hover{
  32. cursor: pointer;
  33. background-color: #ddd;
  34. }
  35. .drow-content:hover .drow-menu{
  36. display: block;
  37. }
  38. .drow-content:hover button{
  39. background-color: #3e8e41;
  40. }
  41. </style>
  42. </head>
  43. <body>
  44. <div class="drow-content">
  45. <button>下拉菜单</button>
  46. <div class="drow-menu">
  47. <div class="drow-item">
  48. 下拉菜单1
  49. </div>
  50. <div class="drow-item">
  51. 下拉菜单2
  52. </div>
  53. <div class="drow-item">
  54. 下拉菜单3
  55. </div>
  56. </div>
  57. </div>
  58. </body>
  59. </html>