图片移动、变形和动画

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

    <style>

 #box1{

            font-size: 20px;

            height: 50px;

            width: 500px;

            border:0.5px solid rgba(0, 0, 0, 0.3);

         

        margin: auto;

            /* display: none; */

            visibility: visible;

            text-align: center;

           line-height: 50px;

        }

        #box2{

       

            height: 450px;

            width: 500px;

            border:0.5px solid rgba(0, 0, 0, 0.3);

        margin: auto;

            /* display: none; */

            visibility: visible;

          position: relative;

         

        }

        #box3{

            width: 450px;

            height: 330px;

            position: relative;

            left: 20px;

            top: 30px;

            border:0.5px solid rgba(0, 0, 0, 0.3);

        }

     

        #img1{

            width: 450px;

            height: 250px;

           

        }

        #img2{

            width: 45px;

            height: 25px;

            position:absolute;

left: 380px;

top:20px;

       z-index: 1;    

        }

#p1{

    line-height: 0px;

    font-size: 25px;

    position: relative;

    left: 10px;

  bottom: 10px;

}

#p2{

    font-size: 20px;

    color: rgb(198, 90, 40);

   

}

#p3{

    font-size: 18px;

    color: white;

position:absolute;

left: 382px;

top:3px;

z-index: 1;  

}

    </style>

</head>

<body>

    <div id="box1">前端开发</div>

  <div id="box2">

     <img id="img2" src="./images/label.png" >

     <p id="p3">点播</p>

    <div id="box3">

       

      <img id="img1" src="./images/01.jpg" >

     

      <p id="p1">Web前端学习</p>

      <p id="p2">您就是未来的前端工程师</p>

     

 

  </div></div>

</body>

</html>

 transform:skew(10deg,10deg) ;

  /* 倾斜x,y deg角度*/

  transform: rotate(10deg);

  /* 旋转:默认中心 */

  transform: scale(1.5,2);

/* 缩放x,y 倍速*/

transform: translate(100px,10px);

/* 移动 x,y,可以是百分比,自身大小的百分比移动 */

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>猫和老鼠</title>

</head>

<style>

   

    #box{

        margin-top: 20%;

        width: 100%;

        height: 10%;

        display: flex;/*设置盒子横向排列 */

        justify-content: space-around;/*设置盒子水平间隔排列 */

    }

    #box1{

        width: 300px;

        height: 200px;

        border-radius: 20px;

        background-image: url(./图片排列/m1.jpg);

        background-size: 100% 100%;

    }

    #box1:hover{

        animation: suofang 1s ease 0s 1;

    }

    @keyframes suofang{

        5%{

            transform: scale(1,1.5);

        }

        20%{

            transform: scale(1.5,0.5);

        }

        50%{

            transform: scale(0.8,1.5);

        }

        60%{

            transform: scale(1.3,0.8);

        }

        70%{

            transform: scale(0.9,1.1);

        }

        80%{

            transform: scale(1,0.9);

        }

    }

    #box2{

        width: 300px;

        height: 200px;

        border-radius:20px;

        background-image: url(./图片排列/m2.jpg);

        background-size: 100% 100%;

    }

    #box2:hover{

        animation: suofang 1s ease 0s 1;

    }

    #box3{

        width: 300px;

        height: 200px;

        border-radius:20px;

        background-image: url(./图片排列/m3.jpg);

        background-size: 100% 100%;

    }

    #box3:hover{

        animation: suofang 1s ease 0s 1;

    }

    #box4{

        width: 300px;

        height: 200px;

        border-radius:20px;

        background-image: url(./图片排列/m4.jpg);

        background-size: 100% 100%;

    }

    #box4:hover{

        animation: suofang 1s ease 0s 1;

    }


 

</style>

<body>

    <div id="box">

        <div id="box1"></div>

        <div id="box2"></div>

        <div id="box3"></div>

        <div id="box4"></div>

    </div>

</body>

</html>

 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值