(共556篇)
全部分类

css 实现文字上下无限自动滚动
[ CSS基础 ] 

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
 HTML
 <div class="demo-list">
    <div class="rowup">
    	<div class="item_txt">我是自动滚动的文字</div>
      <div class="item_txt">我是自动滚动的文字</div>
      <div class="item_txt">我是自动滚动的文字</div>
      <div class="item_txt">我是自动滚动的文字</div>
      <div class="item_txt">我是自动滚动的文字</div>
    </div>
   </div>
   
   CSS
   <style type="text/css">
     @-webkit-keyframes rowup {
       0% {
         -webkit-transform: translate3d(0, 0, 0);
         transform: translate3d(0, 0, 0);
       }
       100% {
         -webkit-transform: translate3d(0, -307px, 0);
         transform: translate3d(0, -307px, 0);
       }
     }
     @keyframes rowup {
       0% {
         -webkit-transform: translate3d(0, 0, 0);
         transform: translate3d(0, 0, 0);
       }
       100% {
         -webkit-transform: translate3d(0, -307px, 0);
         transform: translate3d(0, -307px, 0);
       }
     }

    .demo-list{
      width: 100%;
      position: relative;
      height: 140px;
      overflow: hidden;
    }

  .demo-list .rowup{
    -webkit-animation: 10s rowup linear infinite normal;
    animation: 10s rowup linear infinite normal;
    position: relative;
  }
</style>