css+div实现鼠标向下滚动卡片堆叠效果代码
代码语言:html
所属分类:加载滚动
代码描述:css+div实现鼠标向下滚动卡片堆叠效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { margin-inline: max(0px, ((100% - 260px) / 2)); font: 90%/1.4 system-ui; } .card { position: sticky; top: 0; background: white; padding: 1.5rem; box-shadow: 0 -0.5rem 1rem rgba(0, 0, 0, 0.15); border-radius: 4px; } .card:nth-child(1) { top: 1rem; rotate: 1deg; } .card:nth-child(2) { top: 2rem; rotate: 2deg; } .card:nth-child(3) { top: 3rem; rotate: 3deg; } .card:nth-child(4) { top: 4rem; rotate: 4deg; } .card:nth-child(5) { top: 5rem; rotate: 5deg; } .card:nth-child(6) { top: 6rem; rotate: 6deg; } .card:nth-child(7) { top: 7rem; rotate: 7deg; } .card:nth-child(8) { top: 8rem; rotate: 8deg; } .card:nth-child(9) { top: 9rem; rotate: 9deg; } .card:nth-child(10) { top: 10rem; rotate: 10deg; } .card:nth-child(11) { top: 11rem; rotate: 11deg; } .card:nth-child(12) { top: 12rem; rotate: 12deg; } .card:nth-child(13) { top: 13rem; rotate: 13deg; } .card:nth-child(14) { top: 14rem; rotate: 14deg; } .card:nth-child(15) { top: 15rem; rotate: 15deg; } .card:nth-child(16) { top: 16rem; rotate: 16deg; } .card:nth-child(17) { top: 17rem; rotate: 17deg; } .card:nth-child(18) { top: 18rem; rotate: 18deg; } .card:nth-child(19) { top: 19rem; rotate: 19deg; } .card:nth-child(20) { top: 20rem; rotate: 20deg; } </style> </head> <body > <div class="card"> <h2>Card Title</h2> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Eaque at nobis doloremque odit labore provident unde officiis odio sit sint? Vitae accusantium praesentium ullam alias aut quod cum perferendis maiores.</p> </div> <div class="card"> <h2>Card Title</h2> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Eaque at nobis doloremque odit labore provident unde officiis odio sit sint? Vitae accusantium praesentium ullam alias aut quod cum perferendis maiores.</p> </div> <div class="card"> <h2>Card Title</h2> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Eaque at nobis doloremque odit labore provident unde officiis odio sit sint? Vitae accusantium praesentium ullam alias aut quod cum perferendis maiores.</p> </div> <div class="card"> <h2>Card Title</h2> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Eaque at nobis doloremque odit labore provident unde officiis odio sit sint? Vitae accusantium praesentium ullam alias aut quod cum perferendis maiores.</p> </div> <div class="card"> <h2>Card Title</h2> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Eaque at nobis doloremque odit labore provident unde officiis odio sit sint? Vitae accusantium praesentium ullam alias aut quod cum perferendis maiores.</p> </div> <div class="card"> <h2>Card Title</h2> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Eaque at nobis doloremque odit labore provident unde officiis odio sit sint? Vitae accusantium praesentium ullam alias aut quod cum perferendis maiores.</p> </div> <div class="card"> <h2>Card Title</h2> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Eaque at nobis doloremque odit labore provident unde officiis odio sit sint? Vitae accusantium praesentium ullam alias aut quod cum perferendis maiores.</p> </div&.........完整代码请登录后点击上方下载按钮下载查看
网友评论0