css实现图片横向排列滚动效果代码

代码语言:html

所属分类:加载滚动

代码描述:css实现图片横向排列滚动效果代码

代码标签: css 图片 横向 排列 滚动

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>
 
<meta charset="UTF-8">
 

<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/open-props.css">
 
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/open-props.normalize.min.css">
 
<style>

@font-face {
  font-family: "Geist Sans";
  src: url("//repo.bfw.wiki/bfwrepo/font/GeistVF.ttf") format("truetype");
}
*,
*:after,
*:before {
        box-sizing: border-box;
}

body {
        display: grid;
        place-items: center;
        min-height: 100vh;
        font-family:  'Geist Sans', sans-serif, system-ui;
  width: 100vw;
  overflow-x: hidden;
  font-weight: 80;
  background: hsl(0 0% 8%);
}

ul {
        --width: 100vw;
        width: var(--width);
        height: 100vh;
        padding: 0;
        margin: 0;
        list-style-type: none;
        display: grid;
        place-items: center;
        grid-auto-flow: column;
        gap: 1rem;
        overflow: auto;
        -ms-scroll-snap-type: x mandatory;
            scroll-snap-type: x mandatory;
        padding: 0 calc((var(--width, 80vw) * 0.5) - (var(--card-size, 300px) * 0.5));
}

li {
        scroll-snap-align: center;
}

article {
        width: var(--card-size, 300px);
        aspect-ratio: 3 / 4;
        background: var(--surface-4);
        position: relative;
        overflow: hidden;
  border-radius: var(--radius-3);
  box-shadow:
    var(--shadow-5),
    0 1px inset white;
}

article::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: var(--radius-3);
  border: 6px solid hsl(0 0% 100% / 0.1);
}

/* .backdrop { */
article::after{
  content: "";
  z-index: -1;
        position: absolute;
        inset: 0;
  filter: grayscale(0.5);
        background-image: var(--bg);
        background-size: 200% 200%;
        background-position: 0% 50%;
}

.word {
        -webkit-clip-path: inset(0 0 0 0);
                clip-path: inset(0 0 0 0);
}

span >.........完整代码请登录后点击上方下载按钮下载查看

网友评论0