4.轮播.html 2.2 KB

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