CSS圆形的进度条是怎样做的?
Admin 2021-09-26 群英技术资讯 645 次浏览
CSS圆形的进度条是怎样做的?进度条的效果大家应该比较常见,这一效果的好处就是可以比较明显的反映实现的进度的多少,比较常见的有条线进度条、圆形进度条等等,今天我们就主要来了解圆形进度条的实现。
<div class="wrap"> <div class="progress-radial progress-25"> <div class="overlay">25%</div> </div> <div class="progress-radial progress-50"> <div class="overlay">50%</div> </div> <div class="progress-radial progress-75"> <div class="overlay">75%</div> </div> <div class="progress-radial progress-90"> <div class="overlay">90%</div> </div> </div>
@import url(https://fonts.googleapis.com/css?family=Noto+Sans); body { padding: 30px 0; background-color: #2f3439; font-family: "Noto Sans", sans-serif; } .wrap { width: 600px; margin: 0 auto; } /* ------------------------------------- * Bar container * ------------------------------------- */ .progress-radial { float: left; margin-right: 30px; position: relative; width: 100px; height: 100px; border-radius: 50%; border: 2px solid #2f3439; background-color: tomato; } /* ------------------------------------- * Optional centered circle w/text * ------------------------------------- */ .progress-radial .overlay { position: absolute; width: 60px; height: 60px; background-color: #fffde8; border-radius: 50%; margin-left: 20px; margin-top: 20px; text-align: center; line-height: 60px; font-size: 16px; } /* ------------------------------------- * Mixin for progress-% class * ------------------------------------- */ .progress-0 { background-image: linear-gradient(90deg, #2f3439 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(90deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-5 { background-image: linear-gradient(90deg, #2f3439 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(108deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-10 { background-image: linear-gradient(90deg, #2f3439 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(126deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-15 { background-image: linear-gradient(90deg, #2f3439 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(144deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-20 { background-image: linear-gradient(90deg, #2f3439 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(162deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-25 { background-image: linear-gradient(90deg, #2f3439 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(180deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-30 { background-image: linear-gradient(90deg, #2f3439 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(198deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-35 { background-image: linear-gradient(90deg, #2f3439 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(216deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-40 { background-image: linear-gradient(90deg, #2f3439 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(234deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-45 { background-image: linear-gradient(90deg, #2f3439 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(252deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-50 { background-image: linear-gradient(-90deg, #ff6347 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(270deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-55 { background-image: linear-gradient(-72deg, #ff6347 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(270deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-60 { background-image: linear-gradient(-54deg, #ff6347 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(270deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-65 { background-image: linear-gradient(-36deg, #ff6347 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(270deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-70 { background-image: linear-gradient(-18deg, #ff6347 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(270deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-75 { background-image: linear-gradient(0deg, #ff6347 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(270deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-80 { background-image: linear-gradient(18deg, #ff6347 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(270deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-85 { background-image: linear-gradient(36deg, #ff6347 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(270deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-90 { background-image: linear-gradient(54deg, #ff6347 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(270deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-95 { background-image: linear-gradient(72deg, #ff6347 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(270deg, #ff6347 50%, #2f3439 50%, #2f3439); } .progress-100 { background-image: linear-gradient(90deg, #ff6347 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0)),
linear-gradient(270deg, #ff6347 50%, #2f3439 50%, #2f3439); }
关于CSS圆形的进度条是怎样做的就介绍到这,上述实例具有一定的借鉴价值,感兴趣的朋友可以参考学习,希望能对大家有帮助,想要了解更多CSS的内容,大家可以关注群英网络其它相关文章。
文本转载自脚本之家
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:mmqy2019@163.com进行举报,并提供相关证据,查实之后,将立刻删除涉嫌侵权内容。
猜你喜欢
本文介绍的是一个使用伪元素来实现边框逐渐发光的代码,主要用到scale和opacity这两个属性。下面来看看详细的介绍:效果图如下:HTML代码:代码如下复制代码<divclass="light"><imgsrc="http://tva2.sinaimg.cn/crop.0.0.180.180.180/6830a53bjw8f2qo4xzc2zj20500500t0.jpg"/><divclass="light-inner"><p>前端开发博客</p> ...
这篇文章主要介绍了css3 flex实现div内容水平垂直居中的几种方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
这篇文章给大家分享的是CSS让子元素居中的方法。小编觉得挺实用的,因此分享给大家做个参考,文中的示例代码介绍得很详细,有需要的朋友可以参考,接下来就跟随小编一起了解看看吧。
CSS能实现的布局有很多,这篇文章给大家分享的是Sticky footer布局的实现。小编觉得挺实用的,因此分享给大家做个参考,文中示例代码介绍的很详细,感兴趣的朋友接下来一起跟随小编看看吧。
在平常的样式排版中,我们经常遇到将某个模块隐藏的场景,通过css隐藏元素的方法有很多种,它们看起来实现的效果是一致的,但实际上每一种方法都有一丝轻微的不同,这些不同决定了在一些特定场合下使用哪一种方法。
成为群英会员,开启智能安全云计算之旅
立即注册Copyright © QY Network Company Ltd. All Rights Reserved. 2003-2020 群英 版权所有
增值电信经营许可证 : B1.B2-20140078 粤ICP备09006778号 域名注册商资质 粤 D3.1-20240008