设置圆的渐变色

对于颜色渐变css有着对应的属性

字体颜色渐变

  .tongji-header{
            width: 150px;
            height: 30px;
            font-family: MicrosoftYaHei;
            font-size: 18px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 30px;
            letter-spacing: 0px;
          background: linear-gradient(to right, #01ffff, #0f8dff);
          -webkit-background-clip: text;
          color: transparent;
        }
  <div class="tongji">
             <div class="tongji-header">数据统计 :</div>
             <div style="margin-top: 5px; margin-bottom: 25px; height: 1px; width: 60px; background: linear-gradient(to right, #01ffff, #0f8dff)"></div>
             </div>

下面是效果:
在这里插入图片描述

边框颜色渐变:

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>边框渐变</title>
    <style>
        .circle {
            width: 200px;
            height: 200px;
           
            text-align: center;
            margin: 100px;
            background-color: red;
        }

        .semi-circle {
           border border-radius: 50%;

            border: 20px solid red;
            
            border-image: -moz-linear-gradient(green,blue);
                border-image: -webkit-linear-gradient(green,blue);
                border-image: linear-gradient(to right,green,blue) 30 30;
        }
    </style>
</head>

<body>
    <div class="circle semi-circle"></div>

</body>

</html>

效果:
在这里插入图片描述

如果不需要设置圆形,用border-image:完全可以设置边框渐变
但是如果需要设置圆的颜色渐变这样就不可以了,因为border border-radius不能和border-image: line-gradien兼容 就是设置就border-radius也是不生效的

圆的颜色渐变

 .tongji-top{
            position: relative;
            display: flex;
            align-content:space-around;
          width: 90%;
          height: 199px;
          margin-bottom: 20px;
            /* background-image: linear-gradient(
            #073e64,
            #073e64),
            linear-gradient(
            #0a2043,
            #0a2043); */
            background-blend-mode: normal,
            normal;
            border: solid 1px #01fffd;
            /* opacity: 0.33; */
           
        }
   .tongji-top-yuan{
         height:0;
         width:25%;
         margin: 25px 18px ;
         padding-bottom:25%;
         border-radius: 50%;
          position: relative;
          border: 1px solid transparent;
          border-bottom: 0;
          background-color: #073f6c;
          background-clip: padding-box;
         
          /* padding: 10px; */
          }
        .tongji-top-yuan span {
            display: block;
            margin: 0 auto;
            text-align: center;
            font-size:  60px;
             background: linear-gradient(to right, red, blue);
             -webkit-background-clip: text;
              color: transparent;
        }

                <div class="tongji-top">
                    <div class="tongji-top-left"></div>
                     <div class="tongji-top-right"></div>
                     <div class="tongji-top-yuan tongji-top-yuan1"><span>3</span></div>
                     <div class="tongji-top-yuan tongji-top-yuan2"><span>44</span></div>
                     <div class="tongji-top-yuan tongji-top-yuan3"><span>71</span></div>
                </div>

效果:
在这里插入图片描述

<!DOCTYPE html>
<html>

<head>
    <title>圆边框渐变</title>
    <style type="text/css">
        .son-box {
            position: relative;
            width: 200px;
            height: 200px;
            line-height: 200px;
            border-radius: 50%; // //使之保持圆形状态
            background: white;
            text-align: center;
            margin: 0 auto;
            margin-top: 120px;
        }

        .son-box::after {
            position: absolute;
            content: '';
            background: linear-gradient(red, yellow);
            bottom: 0;
            right: 0;
            left: 0;
            top: 0;
            z-index: -1;
            transform: scale(1.3);  //伪元素放大1.3倍
            border-radius: 50%;  // //使之保持圆形状态
        }
          .son-box span {
         display: block;
         margin: 0 auto;
         text-align: center;
         font-size: 60px;
         background: linear-gradient(to right, red, blue);
         -webkit-background-clip: text;
         color: transparent;
         }
    </style>
</head>

<body>
    <div class="son-box"> <span>张续栋</span> </div>
</body>

</html>

效果: 在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值