5.轮播图.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. * {
  9. margin: 0;
  10. padding: 0;
  11. list-style: none;
  12. text-decoration: none;
  13. box-sizing: border-box;
  14. }
  15. #container {
  16. width: 590px;
  17. height: 470px;
  18. margin: 100px auto;
  19. position: relative;
  20. }
  21. #imgBox {
  22. /* position: absolute;
  23. top: 0; */
  24. }
  25. .selected {
  26. display: none;
  27. }
  28. .choose {
  29. display: block;
  30. }
  31. #list {
  32. overflow: hidden;
  33. position: absolute;
  34. right: 10px;
  35. bottom: 10px;
  36. }
  37. #list li {
  38. float: left;
  39. width: 20px;
  40. height: 20px;
  41. background: purple;
  42. color: #fff;
  43. font-size: 14px;
  44. text-align: center;
  45. line-height: 20px;
  46. border-radius: 50%;
  47. margin-right: 10px;
  48. }
  49. #list .active {
  50. background: #f00;
  51. color: #ff0;
  52. }
  53. #prev,#next {
  54. width: 50px;
  55. height: 50px;
  56. background: rgb(0, 42, 255);
  57. color: #66e21f;
  58. font-size: 30px;
  59. text-align: center;
  60. line-height: 50px;
  61. position: absolute;
  62. top: 50%;
  63. margin-top: -25px;
  64. display: none;
  65. }
  66. #prev {
  67. left: 0;
  68. }
  69. #next {
  70. right: 0;
  71. }
  72. </style>
  73. </head>
  74. <body>
  75. <div id="container">
  76. <div id="imgBox">
  77. <img src="../image/1.jpg" alt="" class="selected choose">
  78. <img src="../image/2.jpg" alt="" class="selected">
  79. <img src="../image/3.jpg" alt="" class="selected">
  80. <img src="../image/4.jpg" alt="" class="selected">
  81. <img src="../image/5.jpg" alt="" class="selected">
  82. </div>
  83. <ul id="list">
  84. <li class="active">1</li>
  85. <li>2</li>
  86. <li>3</li>
  87. <li>4</li>
  88. <li>5</li>
  89. </ul>
  90. <div id="prev">
  91. <span>&lt;</span>
  92. </div>
  93. <div id="next">
  94. <span>&gt;</span>
  95. </div>
  96. </div>
  97. <script src="../js/5.轮播图.js"></script>
  98. </body>
  99. </html>