[css3]跑馬燈


<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;
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM