<!DOCTYPE html>
<html>
<head>
<title>纯H5C3轮播图</title>
<style>
/* 轮播图样式 */
.carousel {
width: 500px;
height: 300px;
overflow: hidden;
position: relative;
animation: slide 12s infinite;
}
.carousel img {
width: 100%;
height: auto;
position: absolute;
opacity: 0;
transition: opacity 1s ease-in-out;
}
.carousel img.active {
opacity: 1;
}
</style>
</head>
<body>
<!-- 轮播图容器 -->
<div class="carousel">
<!-- 图片1 -->
<img src="img1.jpg" alt="图片1" class="inactive">
<!-- 图片2 -->
<img src="img2.jpg" alt="图片2" class="inactive">
<!-- 图片3 -->
<img src="img3.jpg" alt="图片3" class="inactive">
</div>
</body>
</html>
纯Html5,Css3实现的轮播效果
最新推荐文章于 2024-06-26 20:04:17 发布