css渐变,动画

渐变

线性渐变

 background: linear-gradient(red,yellow,blue);
background: linear-gradient(to right,red,yellow,blue); 
background: linear-gradient(to right bottom,red 20%,yellow 60%,blue );
background: linear-gradient(10deg,red,yellow,blue);

 平铺

background: repeating-linear-gradient(30deg,red 20px,yellow 40px);

 径向渐变

background: radial-gradient(red,yellow,blue);
background: radial-gradient(circle,red,yellow,blue);
background: radial-gradient(circle at top left,red,yellow,blue);
background: repeating-radial-gradient(circle at top ,red 40px,yellow 60px);

平移translate

第一个值是 横向偏移量   第二个值是 纵向偏移量

transform: translate(60ox,100px);

旋转 角度的单位

transform: rotate(30-deg);

缩放 默认值是 1 小于1就是缩小,大于1就是放大

 transform: scale(0.6);

改变位置

 top left bottom right center;   

两两组合使用

transform-origin: right center;
transform: translateY(50%)scale(0.5,0.5);
transition: 5s;

 倾斜

transform: skew(-30deg)
nimation: name 2s linear;

 关键帧

 @keyframes name{
            10%{
                width: 200px;
            }
            20%{
                width: 300px;
            }
            40%{
                width: 500px;
            }
            100%{
                width: 200px;
            }
        }

过渡:

  第一个值是属性 一般是all, 也可以是其他属性名称

 第二个值是时间 单位是时间单位 通常是s

第三个值是 过度速度 linear匀速

可以只写时间,其他两个值默认填充all和linear

 transition: all 2s linear

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值