这是一个轮播图案例,本案例使用了三张图片,实现效果如下:
点击下边的小圆点,会自动跳到对应的图片上;点击左右两边的箭头,分别会往后或往前跳一张图片。无任何点击时,会每隔3秒自动换到下一张图片。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>轮播图</title>
<style>
* {
margin: 0;
padding: 0;
list-style: none;
bottom: 0;
text-decoration: none;
}
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-image: linear-gradient(to bottom right,
#355563,
#79afc6,
#878fed,
#