Css3位移动画效果

transform:translate();平移,传进 x,y值,代表沿x轴和y轴平移的距离

transition-delay: 指定对象过渡的延迟时间

代码

    <!doctype

html>

<html>

<head>

<meta
charset="utf-8">

<title>无标题文档</title>

<style>

         .kl{

         width: 340px;

         height: 650px;

}

.kl a{

         display: block;

         width: 340px;

         height:150px;

         background: white;

         margin-bottom: 2px;

         transform:translateX(-340px);

         transition: all 0.4s ease;

         background:rgba(6,110,168,1.00);

}

 

.kl:hover a{

         transform:translateX(0px);

         

}

 

.kl
a:nth-last-of-type(1){

         transition-delay: 0.4s;

}

.kl
a:nth-last-of-type(2){

         transition-delay: 0.3s;

}

.kl
a:nth-last-of-type(3){

         transition-delay: 0.2s;

}

.kl
a:nth-last-of-type(4){

         transition-delay: 0.1s;

}

.kl a img{

    width: 340px;

         height:150px;

}

</style>

</head>

<body>

<div class="kl">

                       <a href=""></a>

                           <a href=""></a>

                           <a href=""></a>

                           <a href=""></a>

       </div>

</body>

    </html>

鼠标没移入之前效果

在这里插入图片描述

鼠标移入的效果

在这里插入图片描述

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值