css 锥形渐变

语法

conic-gradient( [ [ from <angle> ]? [ at <position> ]? ]  ||
  <color-interpolation-method> , <angular-color-stop-list> )  

属性

1. angle

        定义顺时针方向的渐变旋转角度;

        单位包括度的 deg、梯度的 grad、弧度的 rad和圈的 turn。在一个圆中有 360 度,400 个梯度,2π 弧度,1 圈

2. position

        同background-position,定义渐变中心

3. angular-color-stop-list

        颜色断点指,并且跟随一个或两个可选的断点的位置(沿着渐变圆周的angle)

指定2个值时,表示这个颜色的开始和结束角度

<!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>Conic Gradient</title>
  <style>
    .conic-wrapper {
      width: 160px;
      height: 160px;
      border: 1px solid #999;
    }

    .conic-gradient {
      /* 棋盘格 */
      background: conic-gradient(#fff 90deg, #000 0.25turn 0.5turn, #fff 0.5turn 0.75turn, #000 0.75turn);
      background-size: 25% 25%;
      /* 饼图 */
      /* background: conic-gradient(red 36deg, orange 36deg 170deg, yellow 170deg);
      border-radius: 50% */
    }
  </style>
</head>
<body>
  <div class="conic-wrapper conic-gradient">

  </div>
</body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值