CSS3特效之渐变linear-gradient

linear-gradient

语法

 
 
  1. <linear-gradient>:linear-gradient([ <point>,]? <color-stop>[, <color-stop>]+);
  2. <point>:[ left | right ]? [ top | bottom ]? || <angle>?
  3. <color-stop><color> [ <length> | <percentage> ]?

说明

 
 
  1. <point>可取如下值
  2. left:设置左边为渐变起点的横坐标值。
  3. right:设置右边为渐变起点的横坐标值。
  4. top:设置顶部为渐变起点的纵坐标值。
  5. bottom:设置底部为渐变起点的纵坐标值。
  6. <angle>
  7. 用角度值指定渐变的方向(或角度)。
  8. <color-stop>
  9. 指定渐变的起止颜色。

从上到下

 
 
  1. .top-bottom{
  2. background:-moz-linear-gradient(top, #e97e00, #f80200);
  3. background:-webkit-linear-gradient:(top, #e97e00, #f80200);
  4. background:linear-gradient:(top, #e97e00, #f80200);
  5. float:left;
  6. }

从左到右

 
 
  1. .left-right{
  2. background:-moz-linear-gradient(left, #e97e00, #f80200);
  3. background:-webkit-linear-gradient:(left, #e97e00, #f80200);
  4. background:linear-gradient:(left, #e97e00, #f80200);
  5. }

沿45度方向渐变

 
 
  1. .topleft{
  2. background:-moz-linear-gradient(45deg, #e97e00, #f80200);
  3. background:-webkit-linear-gradient:(45deg, #e97e00, #f80200);
  4. background:linear-gradient:(45deg, #e97e00, #f80200);
  5. }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值