Implementation ideas
As shown in the figure: Noted properties:
The following code draws a 33% circle <div class="circle-bar"> <div class="circle-bar-left"></div> <div class="circle-bar-right"></div> <div class="mask"> 33% </div> </div> .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; } /*All descendants are centered horizontally and vertically, so they are concentric circles*/ .circle-bar * { position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: auto; } /*Both the element itself and its sub-elements are circles*/ .circle-bar, .circle-bar > * { border-radius: 50%; } This concludes this article about the sample code for implementing a circular gradient progress bar effect with CSS. For more CSS gradient progress bar content, please search 123WORDPRESS.COM’s previous articles or continue browsing the following related articles. I hope you will support 123WORDPRESS.COM in the future! |
<<: A "classic" pitfall of MySQL UPDATE statement
>>: Interpretation and usage of various React state managers
For a website, it is the most basic function. So l...
First, clarify a few concepts: JDBC: Java databas...
If you need to use an image to implement the use ...
Passive Check With passive health checks, NGINX a...
Table of contents Overview Defining methods on an...
List style properties There are 2 types of lists ...
Preface This article mainly summarizes some of th...
Table of contents 1. Component Registration 2. Us...
Table of contents Brief Analysis of MySQL Master-...
Table of contents 1. Parent components and child ...
I have written an example before, a simple UDP se...
1. Create a database: create data data _name; Two...
To beautify the table, you can set different bord...
Code Sample Add a line of code in the head tag: XM...
No gaps on both sides, gaps between each column w...