首页 > 其他 > 详细

滚动字

时间:2021-09-01 18:03:45      阅读:24      评论:0      收藏:0      [点我收藏+]
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>纯css实现文字循环滚动效果</title>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }
 
        .box {
            width: 300px;
            margin: 0 auto;
            border: 1px solid #ff6700;
            overflow: hidden;
        }
 
        .animate {
            padding-left: 20px;
            font-size: 12px;
            color: #000;
            display: inline-block;
            white-space: nowrap;
            animation: 10s wordsLoop linear infinite normal;
        }

 
        @keyframes wordsLoop {
            0% {
                transform: translateX(250px);
                -webkit-transform: translateX(250px);
            }
            100% {
                transform: translateX(-100%);
                -webkit-transform: translateX(-100%);
            }
        }
 
        @-webkit-keyframes wordsLoop {
            0% {
                transform: translateX(250px);
                -webkit-transform: translateX(250px);
            }
            100% {
                transform: translateX(-100%);
                -webkit-transform: translateX(-100%);
            }
        }
    </style>
</head>
<body>
<div class="box">
    <div class="animate">
        1文字滚动的内容文字滚动   2的内容文字滚动的内容文字滚动的内 3容文字滚动的内容文字滚动的内容文 4字滚动的内容文字滚动的内容文字滚动的内容
    </div>
</div>
</body>
</html>

 

滚动字

原文:https://www.cnblogs.com/xuwupiaomiao/p/15207521.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!