css+div实现图文卡片左右轮播无限无缝滚动代码
代码语言:html
所属分类:加载滚动
代码描述:css+div实现图文卡片左右轮播无限无缝滚动代码
代码标签: css div 图文 卡片 左右 轮播 无限 无缝 滚动 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@layer base, demo;
@import url(https://fonts.bunny.net/css?family=abel:400);
@layer demo {
.carousel {
--items: 6;
--carousel-duration: 40s;
@media (width > 600px) {
--carousel-duration: 30s;
}
--carousel-width: min(
80vw,
800px
); /* note - it will "break" if it gets too wide and there aren't enough items */
--carousel-item-width: 280px;
--carousel-item-height: 450px;
--carousel-item-gap: 2rem;
--clr-cta: rgb(0, 132, 209);
position: relative;
width: var(--carousel-width);
height: var(--carousel-item-height);
overflow: clip;
&[mask] {
/* fade out on sides */
mask-image: linear-gradient(
to right,
transparent,
black 10% 90%,
transparent
);
}
&[reverse] > article {
animation-direction: reverse;
}
/* hover pauses animation */
&:hover > article {
animation-play-state: paused;
}
}
.carousel > article {
position: absolute;
top: 0;
l.........完整代码请登录后点击上方下载按钮下载查看
网友评论0