变换 transform

变换   transform

简单的来说,transform可以做到平移,旋转,缩放,倾斜效果,这些再加上transition或者animation的话,想必效果一定很棒。
先看它都有什么吧。

我写的一个example :
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title></title>
<style>
    P{
        border: medium double #D83C3C;
        background-color: lightgray;
        padding: 5px;
        box-shadow: 0 0 0 5px gray;
    }
    span{
        padding: 4px; 
        border: thin solid red;
        background-color: #AFAAE0;
        font-size: small;
        border-radius: 15px;
    }
    span:hover{
        transform: rotate(360deg);     /* 旋转360度*/  
      transition: all 2s;        /* 过渡2s*/
        background-color: #8461DB;
        font-size: x-large ;
    }
    #right{
        background-color: pink;
    }
    #right:hover{
        
        transform: scale(1.5);   /*放大1.5倍*/
          border: outset double gray;
    }
</style>
</head>
<body>
<h1>请将鼠标移动到下面的矩形上:</h1>
<P>
    As the discribing of the fol picture, a man is meeting with an women, the women is soAs the discribing of the fol picture, a man is meeting with an women, the women is so
    <span >
    两秒旋转360
    </span>
    As the discribing of the fol picture, a man is meeting with an women, the women is soAs the discribing of the fol picture, a man is meeting with an women, the women is soAs the discribing of the fol picture, a man is meeting with an women, the women is so
    
</P>
<input type="button" value="点我把" id="right" />
</body>
</html>


效果图:
还有一个属性是 指定元素变换的起点:transform-origin  ,值有:<%> 指定元素x轴或y轴的起点   <长度值>  指定距离     left  center  Right top center bottom


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值