js+css实现层叠堆积堆叠相册相片拖动效果代码

代码语言:html

所属分类:画廊相册

代码描述:js+css实现层叠堆积堆叠相册相片拖动效果代码

代码标签: js css 堆积 堆叠 相册 相片 拖动 层叠

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

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

<head>
    <meta charset="UTF-8">
    <style>
        @import url("https://fonts.googleapis.com/css2?family=Caveat");.Container {
            position: absolute;
            top: 50%;
            left: 50%
        }
        
        .Picture {
            display: inline-block;
            position: absolute;
            top: 0;
            left: 0;
            border: 5px solid #fff;
            border-radius: 3px;
            background: #fff;
            box-shadow: 0 0 20px rgba(0,0,0,0.3);
            transform: translate(-50%,-50%);
            user-select: none;
            cursor: pointer
        }
        
        .Picture-img {
            display: block;
            width: 300px;
            height: 300px;
            pointer-events: none
        }
        
        .Picture-note {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 300px;
            height: 70px;
            padding: 12px 24px;
            font-size: 1.5rem;
            text-align: center
        }
        
        .Network {
            display: inline-block;
            padding: 0 5px
        }
        
        .Network img {
            width: 1.5rem;
            aspect-ratio: 1 / 1;
            vertical-align: middle
        }
        
        * {
            box-sizing: border-box
        }
        
        body {
            margin: 0;
            font-family: 'Caveat',serif;
            overflow: hidden
        }
    </style>
</head>

<body>
    <div class="Container">
        <div class="Picture">
            <img class="Picture-img" src="//repo.bfw.wiki/random/500x500/景色" alt="" />
            <div class="Picture-note">
                <span>
                        @DeyJordan - 
                        <a class="Network" href="" target="_top">
                            <img src="//repo.bfw.wiki/random/500x500/景色" alt="CodePen"/>
                        </a>
                        <a class="Network" href="hn" target="_top">
                            <img src="//repo.bfw.wiki/random/500x500/景色" alt="twitter"/>
                        </a>
                    </span>
            </div>
        </div>
        <div class="Picture">
            <img class="Picture-img" src="//repo.bfw.wiki/random/500x500/景色" alt="" />
            <div class="Picture-note">
                <span>Over the clouds</span>
            </div>
        </div>
        <div class="Picture">
            <img class="Picture-img" src="//repo.bfw.wiki/random/500x500/景色" alt="" />
            <div class="Picture-note">
                <span>Golden Gate Bridge - San Francisco</span>
            </div>
        </div>
        <div class="Picture">
            <img class="Picture-img" src="//repo.bfw.wiki/random/500x500/景色" alt="" />
            <div class="Picture-note">
                <span>Cat nose</span>
            </div>
        </div>
        <div class="Picture">
            <img class="Picture-img" src="//repo.bfw.wiki/random/500x500/景色" alt="" />
            <div class="Picture-note">
                <span>Mountain</span>
            </div>
        </div>
        <div class="Picture">
            <img class="Picture-img" src="//repo.bfw.wiki/random/500x500/景色" alt="" />
            <div class="Pic.........完整代码请登录后点击上方下载按钮下载查看

网友评论0