6.轮播图.html 2.1 KB

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