<div class="marquee">
    <div>
        <p>纯CSS3生成的走马灯效果</p>
        <p>纯CSS3生成的走马灯效果</p>
    </div>
</div>        
/* 定义一个走马灯动画 */

@-webkit-keyframes marquee {
    0% { left: 0; }
    100% { left: -100%; }
}
@keyframes marquee {
    0%{left:0}
    100%{left: -100%}
}

.marquee {
    height: 30px;
    overflow: hidden;
    position: relative;
}

.marquee div {
    display: block;
    width: 200%;
    height: 30px;
    position: absolute;
    overflow: hidden;
    -webkit-animation: marquee 4s linear infinite;
    animation: marquee 4s linear infinite;
}

 

相关文章:

  • 2022-12-23
  • 2021-08-30
  • 2022-01-12
  • 2021-09-14
  • 2022-02-17
  • 2022-12-23
猜你喜欢
  • 2021-12-31
  • 2021-12-20
  • 2022-12-23
  • 2021-09-05
  • 2022-02-05
相关资源
相似解决方案