{"id":1251,"date":"2024-11-10T13:27:11","date_gmt":"2024-11-10T05:27:11","guid":{"rendered":"https:\/\/fwq.ai\/blog\/1251\/"},"modified":"2024-11-10T13:27:11","modified_gmt":"2024-11-10T05:27:11","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-css-%e5%8a%a8%e7%94%bb%e4%b8%ad%e5%ae%9e%e7%8e%b0%e7%aa%81%e5%8f%98%e6%95%88%e6%9e%9c%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/1251\/","title":{"rendered":"\u5982\u4f55\u5728 CSS \u52a8\u753b\u4e2d\u5b9e\u73b0\u7a81\u53d8\u6548\u679c\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173034165160677.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5728 CSS \u52a8\u753b\u4e2d\u5b9e\u73b0\u7a81\u53d8\u6548\u679c\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u5728 CSS \u52a8\u753b\u4e2d\u5b9e\u73b0\u7a81\u53d8\u6548\u679c\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong> \u52a8\u753b\uff1a\u5b9e\u73b0\u7a81\u53d8\u6548\u679c<\/strong><\/p>\n<p>\u5728 CSS \u52a8\u753b\u4e2d\u5b9e\u73b0\u7a81\u53d8\u6548\u679c\uff0c\u5373\u5728\u52a8\u753b\u8fc7\u7a0b\u4e2d\u8df3\u8fc7\u67d0\u4e00\u6bb5\u8ddd\u79bb\uff0c\u6709\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\uff1a<\/p>\n<ul>\n<li> <strong>\u8d1f\u6570\u5ef6\u65f6 (animation-delay)\uff1a<\/strong><br \/>\u901a\u8fc7\u8bbe\u7f6e\u8d1f\u6570\u7684\u5ef6\u65f6\u5c5e\u6027\uff0c\u53ef\u4ee5\u63d0\u524d\u5f00\u59cb\u52a8\u753b\u3002\u4f8b\u5982\uff0c\u8981\u4ece 30% \u5f00\u59cb\u79fb\u52a8\u5230 100%\uff0c\u53ef\u4ee5\u8bbe\u7f6e -3s \u7684\u5ef6\u65f6\uff0c\u4ece\u52a8\u753b\u5f00\u59cb\u5373\u79fb\u52a8\u5230 30%\u3002<\/li>\n<li> <strong>\u591a\u4e2a\u52a8\u753b\uff1a<\/strong><br \/>\u4e3a\u4e0d\u540c\u7684\u79fb\u52a8\u9636\u6bb5\u521b\u5efa\u5355\u72ec\u7684\u52a8\u753b\u3002\u4f8b\u5982\uff0c\u4ece 0% \u5230 30% \u7684\u79fb\u52a8\u53ef\u4ee5\u7528\u4e00\u4e2a\u52a8\u753b\uff0c\u4ece 30% \u5230 100% \u7684\u79fb\u52a8\u53ef\u4ee5\u7528\u53e6\u4e00\u4e2a\u52a8\u753b\u3002<\/li>\n<li> <strong>\u8fd0\u52a8\u8def\u5f84\uff1a<\/strong><br \/>\u4f7f\u7528\u8fd0\u52a8\u8def\u5f84\u529f\u80fd (CSS transform-functions)\uff0c\u7ed8\u5236\u590d\u6742\u7684\u8fd0\u52a8\u8def\u5f84\uff0c\u5b9e\u73b0\u7a81\u53d8\u6548\u679c\u3002\u4f46\u662f\uff0c\u8fd9\u79cd\u65b9\u6cd5\u9700\u8981\u6d4f\u89c8\u5668\u652f\u6301 transform-functions\u3002<\/li>\n<\/ul>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<p>\u5047\u8bbe\u6709\u4e24\u4e2a\u7bad\u5934\uff0c\u9700\u8981\u4ece\u5de6\u5230\u53f3\u79fb\u52a8\uff0c\u7bad\u5934 B \u9700\u8981\u5148\u4ece 30% \u79fb\u52a8\u5230 100%\uff0c\u518d\u4ece 0 \u5f00\u59cb\u79fb\u52a8\u5230 30%\u3002<\/p>\n<p><strong>\u4f7f\u7528\u8d1f\u6570\u5ef6\u65f6\uff1a<\/strong><\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<pre>&lt;div class=\"arrow a\"&gt;&lt;\/div&gt;\n&lt;div class=\"arrow b\"&gt;&lt;\/div&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<pre>@keyframes move1 {\n  0% {\n    left: 0;\n  }\n  100% {\n    left: 100px;\n  }\n}\n\n.arrow {\n  animation: 10s linear move1;\n}\n\n.b {\n  animation-delay: -3s;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u4f7f\u7528\u591a\u4e2a\u52a8\u753b\uff1a<\/strong><\/p>\n<pre>&lt;div class=\"arrow a\"&gt;&lt;\/div&gt;\n&lt;div class=\"arrow b\"&gt;&lt;\/div&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<pre>@keyframes move1 {\n  0% {\n    left: 0;\n  }\n  30% {\n    left: 30px;\n  }\n}\n\n@keyframes move2 {\n  0% {\n    left: 30px;\n  }\n  100% {\n    left: 100px;\n  }\n}\n\n.arrow {\n  animation: 10s linear move1;\n}\n\n.b {\n  animation: 5s linear move2;\n  animation-delay: 3s;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5728 CSS \u52a8\u753b\u4e2d\u5b9e\u73b0\u7a81\u53d8\u6548\u679c\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>\u52a8\u753b\uff1a\u5b9e\u73b0\u7a81\u53d8\u6548\u679c \u5728 CSS \u52a8\u753b\u4e2d\u5b9e\u73b0\u7a81\u53d8\u6548\u679c\uff0c\u5373\u5728\u52a8\u753b\u8fc7\u7a0b\u4e2d\u8df3\u8fc7\u67d0\u4e00\u6bb5\u8ddd\u79bb\uff0c\u6709\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\uff1a \u8d1f\u6570\u5ef6\u65f6 (animation-delay)\uff1a\u901a\u8fc7\u8bbe\u7f6e\u8d1f\u6570\u7684\u5ef6\u65f6\u5c5e\u6027\uff0c\u53ef\u4ee5\u63d0\u524d\u5f00\u59cb\u52a8\u753b\u3002\u4f8b\u5982\uff0c\u8981\u4ece 30% \u5f00\u59cb\u79fb\u52a8\u5230 100%\uff0c\u53ef\u4ee5\u8bbe\u7f6e -3s \u7684\u5ef6\u65f6\uff0c\u4ece\u52a8\u753b\u5f00\u59cb\u5373\u79fb\u52a8\u5230 30%\u3002 \u591a\u4e2a\u52a8\u753b\uff1a\u4e3a\u4e0d\u540c\u7684\u79fb\u52a8\u9636\u6bb5\u521b\u5efa\u5355\u72ec\u7684\u52a8\u753b\u3002\u4f8b\u5982\uff0c\u4ece 0% \u5230 30% \u7684\u79fb\u52a8\u53ef\u4ee5\u7528\u4e00\u4e2a\u52a8\u753b\uff0c\u4ece 30% \u5230 100% \u7684\u79fb\u52a8\u53ef\u4ee5\u7528\u53e6\u4e00\u4e2a\u52a8\u753b\u3002 \u8fd0\u52a8\u8def\u5f84\uff1a\u4f7f\u7528\u8fd0\u52a8\u8def\u5f84\u529f\u80fd (CSS transform-functions)\uff0c\u7ed8\u5236\u590d\u6742\u7684\u8fd0\u52a8\u8def\u5f84\uff0c\u5b9e\u73b0\u7a81\u53d8\u6548\u679c\u3002\u4f46\u662f\uff0c\u8fd9\u79cd\u65b9\u6cd5\u9700\u8981\u6d4f\u89c8\u5668\u652f\u6301 transform-functions\u3002 \u793a\u4f8b\uff1a \u5047\u8bbe\u6709\u4e24\u4e2a\u7bad\u5934\uff0c\u9700\u8981\u4ece\u5de6\u5230\u53f3\u79fb\u52a8\uff0c\u7bad\u5934 B \u9700\u8981\u5148\u4ece 30% \u79fb\u52a8\u5230 100%\uff0c\u518d\u4ece 0 \u5f00\u59cb\u79fb\u52a8\u5230 30%\u3002 \u4f7f\u7528\u8d1f\u6570\u5ef6\u65f6\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b &lt;div class=&#8221;arrow a&#8221;&gt;&lt;\/div&gt; &lt;div class=&#8221;arrow b&#8221;&gt;&lt;\/div&gt; \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 @keyframes move1 { 0% { left: 0; } 100% { [&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-1251","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1251","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=1251"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1251\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=1251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=1251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=1251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}