028-86922220

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

css怎么实现圆形渐变进度条效果

这篇文章给大家分享的是有关css怎么实现圆形渐变进度条效果的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

网站建设哪家好,找创新互联!专注于网页设计、网站建设、微信开发、重庆小程序开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了临翔免费建站欢迎大家使用!

实现思路

如图所示:

css怎么实现圆形渐变进度条效果

注意到的属性:

下面代码是绘制 33%的圆


    
    
             33%     
.circle-bar {
    background-image: linear-gradient(#7affaf, #7a88ff);
    width: 182px;
    height: 182px;
    position: relative;
}
.circle-bar-left {
    background-color: #e9ecef;
    width: 182px;
    height: 182px;
    clip: rect(0, 91px, auto, 0);
}
.circle-bar-right {
    background-color: #e9ecef;
    width: 182px;
    height: 182px;
    clip: rect(0, auto, auto, 91px);
    transform: rotate(118.8deg);
}
.mask {
    width: 140px;
    height: 140px;
    background-color: #fff;
    text-align: center;
    line-height: 0.2em;
    color: rgba(0, 0, 0, 0.5);
    position: absolute;
    left: 21px;
    top: 21px;
}
.mask > span {
    display: block;
    font-size: 44px;
    line-height: 150px;
}
/*所有的后代都水平垂直居中,这样就是同心圆了*/
.circle-bar * {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    margin: auto;
}
/*自身以及子元素都是圆*/
.circle-bar,
.circle-bar > * {
    border-radius: 50%;
}

感谢各位的阅读!关于“css怎么实现圆形渐变进度条效果”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!


网站名称:css怎么实现圆形渐变进度条效果
标题路径:http://www.tsicrk.com/article/joiepj.html
  • 网站建设专属方案

  • 网站定制化设计

  • 7X24小时服务

  • N对管家服务

让你的专属顾问为你服务

0.6719s