CSS3 画线

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

 

转载于:https://www.cnblogs.com/eturn/p/4549915.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值