码迷,mamicode.com
首页 > Web开发 > 详细

CSS3 画线

时间:2015-06-03 19:33:40      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:

<style>
div {
    border: 1px solid;
}
div .line {
    width: 2px;
    height: 2px;
    background-color: red;
    color: red;
    border-radius: 2px;
}
#container{
    width: 800px;
    height:600px;
    position: relative;
}

#div1 {
    -webkit-animation: aaa 4s;
    -webkit-animation-iteration-count: infinite;
}
#div2 {
    position: absolute;
    left: 500px;
    -webkit-animation: bbb 4s;
    -webkit-animation-direction: normal;
    /*normal (每次从正方向开始)
        animation-direction: reverse (每次从反方向开始)
        animation-direction: alternate (正反往复)*/
    -webkit-animation-iteration-count: infinite;
}
#div3 {
    position: absolute;
    top: 500px;
    -webkit-animation: ccc 4s;
    -webkit-animation-iteration-count: infinite;
}
#div4 {
    position: absolute;
    left: 0;
    -webkit-animation: ddd 4s;
    -webkit-animation-direction: normal;
    -webkit-animation-iteration-count: infinite;
}
@-webkit-keyframes aaa
{
    0% {
        width: 2px;
    }
    25%,100% {
        width: 500px;
    }
}
@-webkit-keyframes bbb
{
    0% {
    }
    25% {
        height: 2px;
    }
    50%,100% {
        height: 500px;
    }
}

@-webkit-keyframes ccc
{
    50% {
        width: 2px;
        left: 500px;
    }
    75%,100%{
        width: 500px;
        left: 0;
    }
}

@-webkit-keyframes ddd
{
    75% {
        height: 2px;
        top:498px;
    }
    100% {
        height: 500px;
        top:0px;
    }
}
</style>
11111111
<br> 22222222222
<br> 33333333333
<br>
<div id="container">
    <div id="div1" class="line">
    </div>
    <div id="div2" class="line"></div>
    <div id="div3" class="line"></div>
    <div id="div4" class="line"></div>
</div>

 

CSS3 画线

标签:

原文地址:http://www.cnblogs.com/eturn/p/4549915.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!