{"id":53106,"date":"2024-12-03T15:49:50","date_gmt":"2024-12-03T07:49:50","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53106\/"},"modified":"2024-12-03T15:49:50","modified_gmt":"2024-12-03T07:49:50","slug":"%e5%a6%82%e4%bd%95%e7%94%a8-css-%e5%b7%a7%e5%a6%99%e8%bd%ac%e6%8d%a2%e6%95%b0%e5%ad%97%e5%8f%98%e9%87%8f%e4%b8%ba%e5%ad%97%e7%ac%a6%e4%b8%b2%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53106\/","title":{"rendered":"\u5982\u4f55\u7528 CSS \u5de7\u5999\u8f6c\u6362\u6570\u5b57\u53d8\u91cf\u4e3a\u5b57\u7b26\u4e32\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u7528 CSS \u5de7\u5999\u8f6c\u6362\u6570\u5b57\u53d8\u91cf\u4e3a\u5b57\u7b26\u4e32\uff1f<\/h1>\n<p><span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span>    <\/p>\n<p>\u54c8\u55bd\uff01\u4eca\u5929\u5fc3\u8840\u6765\u6f6e\u7ed9\u5927\u5bb6\u5e26\u6765\u4e86<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u5982\u4f55\u7528 CSS \u5de7\u5999\u8f6c\u6362\u6570\u5b57\u53d8\u91cf\u4e3a\u5b57\u7b26\u4e32\uff1f\u300b<\/span>\uff0c\u60f3\u5fc5\u5927\u5bb6\u5e94\u8be5\u5bf9<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u90fd\u4e0d\u964c\u751f\u5427\uff0c\u90a3\u4e48\u9605\u8bfb\u672c\u6587\u5c31\u90fd\u4e0d\u4f1a\u5f88\u56f0\u96be\uff0c\u4ee5\u4e0b\u5185\u5bb9\u4e3b\u8981\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\uff0c\u82e5\u662f\u4f60\u6b63\u5728\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\uff0c\u5343\u4e07\u522b\u9519\u8fc7\u8fd9\u7bc7\u6587\u7ae0~\u5e0c\u671b\u80fd\u5e2e\u52a9\u5230\u4f60\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241126\/17326210116745b2d30527c.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u7528 CSS \u5de7\u5999\u8f6c\u6362\u6570\u5b57\u53d8\u91cf\u4e3a\u5b57\u7b26\u4e32\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u7528 CSS \u5de7\u5999\u8f6c\u6362\u6570\u5b57\u53d8\u91cf\u4e3a\u5b57\u7b26\u4e32\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>css \u53d8\u91cf\u4e2d\u6570\u5b57\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u64cd\u4f5c\u65b9\u6cd5<\/strong><\/p>\n<p>\u5728 css \u4ee3\u7801\u4e2d\uff0c\u5982\u679c\u5c06\u53d8\u91cf &#8211;progress \u8bbe\u7f6e\u4e3a\u6570\u5b57\uff0c\u5219\u65e0\u6cd5\u5c06\u5176\u4e0e\u767e\u5206\u53f7\u7b26\u53f7\u8fde\u63a5\u3002\u4f46\u662f\uff0c\u5982\u679c\u5c06\u5176\u8bbe\u7f6e\u4e3a\u5b57\u7b26\u4e32\uff0c\u5219\u65e0\u6cd5\u4f7f\u7528 calc() \u51fd\u6570\u5bf9\u5176\u8fdb\u884c\u8ba1\u7b97\u3002<\/p>\n<p>\u8981\u540c\u65f6\u89e3\u51b3\u8fd9\u4e24\u4e2a\u95ee\u9898\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 counter-reset \u5c5e\u6027\uff1a<\/p>\n<pre>.progress-radial {\n  --progress: 25;\n}\n\n.progress-radial:before {\n  transform: rotate(calc(var(--progress) * 3.6deg)) translate(0, -72.5px);\n}\n\n.progress-radial b:after {\n  counter-reset: showprogress var(--progress);\n  content: counter(showprogress) \"%\";\n}<\/pre>\n<pre>&lt;div class=\"progress-radial\"&gt;\u5c55\u793a\u8fdb\u5ea6\u503c\uff1a&lt;b&gt;&lt;\/b&gt;&lt;\/div&gt;<\/pre>\n<p>\u5728\u8fd9\u4e2a\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528 counter-reset \u4e3a\u4e00\u4e2a\u540d\u4e3a showprogress \u7684\u8ba1\u6570\u5668\u91cd\u7f6e\u503c\u4e3a var(&#8211;progress)\u3002\u7136\u540e\uff0c\u6211\u4eec\u5728 b:after \u4f2a\u5143\u7d20\u4e2d\u4f7f\u7528 counter() \u51fd\u6570\u5f15\u7528\u8be5\u8ba1\u6570\u5668\u5e76\u5c06\u5176\u9644\u52a0\u5230\u767e\u5206\u53f7\u7b26\u53f7\u4e0a\u3002<\/p>\n<p>\u8fd9\u6837\uff0c&#8211;progress \u5c31\u53ef\u4ee5\u540c\u65f6\u4f5c\u4e3a\u4e00\u4e2a\u6570\u5b57\uff08\u7528\u4e8e\u8ba1\u7b97\uff09\u548c\u4e00\u4e2a\u5b57\u7b26\u4e32\uff08\u7528\u4e8e\u8fde\u63a5\u767e\u5206\u53f7\u7b26\u53f7\uff09\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u672c\u6587\u7684\u5168\u90e8\u5185\u5bb9\u4e86\uff0c\u662f\u5426\u6709\u987a\u5229\u5e2e\u52a9\u4f60\u89e3\u51b3\u95ee\u9898\uff1f\u82e5\u662f\u80fd\u7ed9\u4f60\u5e26\u6765\u5b66\u4e60\u4e0a\u7684\u5e2e\u52a9\uff0c\u8bf7\u5927\u5bb6\u591a\u591a\u652f\u6301\u7c73\u4e91\uff01\u66f4\u591a\u5173\u4e8e\u6587\u7ae0\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u3002<\/p>\n<p>      \u7248\u672c\u58f0\u660e \u672c\u6587\u8f6c\u8f7d\u4e8e\uff1aphp \u5982\u6709\u4fb5\u72af\uff0c\u8bf7\u8054\u7cfb\u5220\u9664    <\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   \u60e0\u666e\u7535\u8111\u600e\u4e48\u7528\u5149\u76d8\u88c5win7\u7cfb\u7edf\uff1f\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u7528 CSS \u5de7\u5999\u8f6c\u6362\u6570\u5b57\u53d8\u91cf\u4e3a\u5b57\u7b26\u4e32\uff1f \u6536\u85cf \u54c8\u55bd\uff01\u4eca\u5929\u5fc3\u8840\u6765\u6f6e\u7ed9\u5927\u5bb6\u5e26\u6765\u4e86\u300a\u5982\u4f55\u7528 CSS \u5de7\u5999\u8f6c\u6362\u6570\u5b57\u53d8\u91cf\u4e3a\u5b57\u7b26\u4e32\uff1f\u300b\uff0c\u60f3\u5fc5\u5927\u5bb6\u5e94\u8be5\u5bf9\u6587\u7ae0\u90fd\u4e0d\u964c\u751f\u5427\uff0c\u90a3\u4e48\u9605\u8bfb\u672c\u6587\u5c31\u90fd\u4e0d\u4f1a\u5f88\u56f0\u96be\uff0c\u4ee5\u4e0b\u5185\u5bb9\u4e3b\u8981\u6d89\u53ca\u5230\uff0c\u82e5\u662f\u4f60\u6b63\u5728\u5b66\u4e60\u6587\u7ae0\uff0c\u5343\u4e07\u522b\u9519\u8fc7\u8fd9\u7bc7\u6587\u7ae0~\u5e0c\u671b\u80fd\u5e2e\u52a9\u5230\u4f60\uff01 css \u53d8\u91cf\u4e2d\u6570\u5b57\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u64cd\u4f5c\u65b9\u6cd5 \u5728 css \u4ee3\u7801\u4e2d\uff0c\u5982\u679c\u5c06\u53d8\u91cf &#8211;progress \u8bbe\u7f6e\u4e3a\u6570\u5b57\uff0c\u5219\u65e0\u6cd5\u5c06\u5176\u4e0e\u767e\u5206\u53f7\u7b26\u53f7\u8fde\u63a5\u3002\u4f46\u662f\uff0c\u5982\u679c\u5c06\u5176\u8bbe\u7f6e\u4e3a\u5b57\u7b26\u4e32\uff0c\u5219\u65e0\u6cd5\u4f7f\u7528 calc() \u51fd\u6570\u5bf9\u5176\u8fdb\u884c\u8ba1\u7b97\u3002 \u8981\u540c\u65f6\u89e3\u51b3\u8fd9\u4e24\u4e2a\u95ee\u9898\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 counter-reset \u5c5e\u6027\uff1a .progress-radial { &#8211;progress: 25; } .progress-radial:before { transform: rotate(calc(var(&#8211;progress) * 3.6deg)) translate(0, -72.5px); } .progress-radial b:after { counter-reset: showprogress var(&#8211;progress); content: counter(showprogress) &#8220;%&#8221;; } &lt;div class=&#8221;progress-radial&#8221;&gt;\u5c55\u793a\u8fdb\u5ea6\u503c\uff1a&lt;b&gt;&lt;\/b&gt;&lt;\/div&gt; \u5728\u8fd9\u4e2a\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528 counter-reset \u4e3a\u4e00\u4e2a\u540d\u4e3a showprogress \u7684\u8ba1\u6570\u5668\u91cd\u7f6e\u503c\u4e3a var(&#8211;progress)\u3002\u7136\u540e\uff0c\u6211\u4eec\u5728 b:after \u4f2a\u5143\u7d20\u4e2d\u4f7f\u7528 counter() \u51fd\u6570\u5f15\u7528\u8be5\u8ba1\u6570\u5668\u5e76\u5c06\u5176\u9644\u52a0\u5230\u767e\u5206\u53f7\u7b26\u53f7\u4e0a\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-53106","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=53106"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53106\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}