• CSS实现简单无缝滚动


    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
        *{
            margin: 0;
            padding: 0;
        }
        .wrap{
            width: 500px;
            height: 100px;
            box-shadow: 0 0 120px #333;
            overflow: hidden;
            margin: 50px auto;
            cursor: pointer;
            position: relative;
        }
        .list{
            width: 200%;
            height: 100px;
            position: absolute;
            top: 0;
            left: 0;
            overflow: hidden;
        }
        .list li{
            list-style-type: none;
            float: left;
            margin: 10px;
            width: 74px;
            height: 74px;
            line-height: 74px;
            color: #414141;
            text-align: center;
            font-size: 52px;
            text-shadow: 1px 1px 0px rgba(255,255,255,.55);
            border: 1px solid #333;
            padding: 2px;
            background-color: orange;
        }
        @-webkit-keyframes move{
            from{
                left: 0;    /*这里使用translate移动时,hover暂停时会有回弹,原因不详*/
                /*-webkit-transform:translate3d(0,0,0);*/
            }
            to{
                left: -500px;
                /*-webkit-transform:translate3d(-500px,0,0);*/
            }
        }
        .animate{
            -webkit-animation:move 5s linear infinite;
        }
        .wrap:hover .animate{
            -webkit-animation-play-state: paused;
        }
        </style>
    </head>
    <body>
        <div class="wrap">
            <ul class="list animate">
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
                <li>5</li>
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
                <li>5</li>
            </ul>
        </div>
    </body>
    </html>
  • 相关阅读:
    Redis安装与配置
    Mysql主从复制
    MySQL的基本使用
    如何理解 python 里面的 for 循环
    我在创业公司的 “云原生” 之旅
    linux 安装 kafka
    数据库性能优化
    Shell 中各种括号的作用
    DNS 配置实例-正反解析-主从同步-分离解析
    DHCP 中继转发配置(ensp 实现)
  • 原文地址:https://www.cnblogs.com/jiujiaoyangkang/p/4942540.html
Copyright © 2020-2023  润新知