{"id":3654,"date":"2024-11-10T08:00:07","date_gmt":"2024-11-10T00:00:07","guid":{"rendered":"https:\/\/fwq.ai\/blog\/3654\/"},"modified":"2024-11-10T08:00:07","modified_gmt":"2024-11-10T00:00:07","slug":"%e5%a6%82%e4%bd%95%e7%ae%80%e5%8c%96-css-%e5%8a%a8%e7%94%bb%e4%b8%ad%e6%97%8b%e8%bd%ac%e8%a7%92%e5%ba%a6%e7%9a%84%e7%99%be%e5%88%86%e6%af%94%e8%a1%a8%e7%a4%ba%e6%96%b9%e5%bc%8f%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/3654\/","title":{"rendered":"\u5982\u4f55\u7b80\u5316 CSS \u52a8\u753b\u4e2d\u65cb\u8f6c\u89d2\u5ea6\u7684\u767e\u5206\u6bd4\u8868\u793a\u65b9\u5f0f\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173111186510647.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u7b80\u5316 CSS \u52a8\u753b\u4e2d\u65cb\u8f6c\u89d2\u5ea6\u7684\u767e\u5206\u6bd4\u8868\u793a\u65b9\u5f0f\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u7b80\u5316 CSS \u52a8\u753b\u4e2d\u65cb\u8f6c\u89d2\u5ea6\u7684\u767e\u5206\u6bd4\u8868\u793a\u65b9\u5f0f\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u7b80\u5316  \u52a8\u753b\u4e2d\u65cb\u8f6c\u89d2\u5ea6\u767e\u5206\u6bd4\u7684\u8868\u793a\u65b9\u5f0f<\/strong><\/p>\n<p>\u5728 css \u52a8\u753b\u4e2d\uff0c\u4f7f\u7528\u81ea\u5b9a\u4e49\u5c5e\u6027 &#8211;rotate-angle \u6765\u63a7\u5236\u5143\u7d20\u7684\u65cb\u8f6c\u89d2\u5ea6\uff0c\u901a\u5e38\u9700\u8981\u5b9a\u4e49\u9010\u4e2a\u767e\u5206\u6bd4\u7684\u5c5e\u6027\u503c\uff0c\u4f8b\u5982\u4ece 0% \u5230 100% \u6bcf 1% \u589e\u52a0\u4e00\u4e2a\u65b0\u7684\u503c\u3002<\/p>\n<p>\u4e3a\u4e86\u7b80\u5316\u4e66\u5199\u65b9\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5c06\u81ea\u5b9a\u4e49\u5c5e\u6027\u5b9a\u4e49\u4e3a\u89d2\u5ea6\u5c5e\u6027\u6765\u5b9e\u73b0\u3002\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u5728 css \u4e2d\u5b9a\u4e49\u81ea\u5b9a\u4e49\u5c5e\u6027 &#8211;rotate-angle \u7684\u8bed\u6cd5\u7c7b\u578b\u4e3a\u89d2\u5ea6\uff1a<\/li>\n<\/ol>\n<pre>@property --rotate-angle {\n  syntax: '&lt;angle&gt;';\n  inherits: false;\n  initial-value: 0deg;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u5728\u52a8\u753b\u5173\u952e\u5e27\u89c4\u5219\u4e2d\u4f7f\u7528 &#8211;rotate-angle \u5c5e\u6027\u503c\uff0c\u800c\u65e0\u9700\u9010\u4e2a\u767e\u5206\u6bd4\u6307\u5b9a\uff1a<\/li>\n<\/ol>\n<pre>@keyframes rotate {\n  0% {\n    --rotate-angle: 0deg;\n  }\n\n  100% {\n    --rotate-angle: 360deg;\n  }\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u5728\u9700\u8981\u5e94\u7528\u65cb\u8f6c\u52a8\u753b\u7684\u5143\u7d20\u4e0a\uff0c\u4f7f\u7528 rotate \u5c5e\u6027\u5f15\u7528 &#8211;rotate-angle \u503c\uff1a<\/li>\n<\/ol>\n<pre>#el {\n  rotate: var(--rotate-angle);\n  animation: rotate 3s linear;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ea\u9700\u5b9a\u4e49\u5173\u952e\u5e27\u7684\u5f00\u59cb\u548c\u7ed3\u675f\u89d2\u5ea6\uff0c\u5373\u53ef\u5b9e\u73b0\u968f\u767e\u5206\u6bd4\u8fdb\u5ea6\u5e73\u6ed1\u8fc7\u6e21\u7684\u65cb\u8f6c\u52a8\u753b\u3002<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u7b80\u5316 CSS \u52a8\u753b\u4e2d\u65cb\u8f6c\u89d2\u5ea6\u7684\u767e\u5206\u6bd4\u8868\u793a\u65b9\u5f0f\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b80\u5316 \u52a8\u753b\u4e2d\u65cb\u8f6c\u89d2\u5ea6\u767e\u5206\u6bd4\u7684\u8868\u793a\u65b9\u5f0f \u5728 css \u52a8\u753b\u4e2d\uff0c\u4f7f\u7528\u81ea\u5b9a\u4e49\u5c5e\u6027 &#8211;rotate-angle \u6765\u63a7\u5236\u5143\u7d20\u7684\u65cb\u8f6c\u89d2\u5ea6\uff0c\u901a\u5e38\u9700\u8981\u5b9a\u4e49\u9010\u4e2a\u767e\u5206\u6bd4\u7684\u5c5e\u6027\u503c\uff0c\u4f8b\u5982\u4ece 0% \u5230 100% \u6bcf 1% \u589e\u52a0\u4e00\u4e2a\u65b0\u7684\u503c\u3002 \u4e3a\u4e86\u7b80\u5316\u4e66\u5199\u65b9\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5c06\u81ea\u5b9a\u4e49\u5c5e\u6027\u5b9a\u4e49\u4e3a\u89d2\u5ea6\u5c5e\u6027\u6765\u5b9e\u73b0\u3002\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a \u5728 css \u4e2d\u5b9a\u4e49\u81ea\u5b9a\u4e49\u5c5e\u6027 &#8211;rotate-angle \u7684\u8bed\u6cd5\u7c7b\u578b\u4e3a\u89d2\u5ea6\uff1a @property &#8211;rotate-angle { syntax: &#8216;&lt;angle&gt;&#8217;; inherits: false; initial-value: 0deg; } \u767b\u5f55\u540e\u590d\u5236 \u5728\u52a8\u753b\u5173\u952e\u5e27\u89c4\u5219\u4e2d\u4f7f\u7528 &#8211;rotate-angle \u5c5e\u6027\u503c\uff0c\u800c\u65e0\u9700\u9010\u4e2a\u767e\u5206\u6bd4\u6307\u5b9a\uff1a @keyframes rotate { 0% { &#8211;rotate-angle: 0deg; } 100% { &#8211;rotate-angle: 360deg; } } \u767b\u5f55\u540e\u590d\u5236 \u5728\u9700\u8981\u5e94\u7528\u65cb\u8f6c\u52a8\u753b\u7684\u5143\u7d20\u4e0a\uff0c\u4f7f\u7528 rotate \u5c5e\u6027\u5f15\u7528 &#8211;rotate-angle \u503c\uff1a #el { [&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-3654","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/3654","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=3654"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/3654\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=3654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=3654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=3654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}