{"id":1283,"date":"2024-11-10T10:44:33","date_gmt":"2024-11-10T02:44:33","guid":{"rendered":"https:\/\/fwq.ai\/blog\/1283\/"},"modified":"2024-11-10T10:44:33","modified_gmt":"2024-11-10T02:44:33","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-css-%e5%ae%9e%e7%8e%b0%e5%8a%a8%e7%94%bb%e7%aa%81%e5%8f%98%e7%a7%bb%e5%8a%a8%e6%95%88%e6%9e%9c%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/1283\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 CSS \u5b9e\u73b0\u52a8\u753b\u7a81\u53d8\u79fb\u52a8\u6548\u679c\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173035219568360.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 CSS \u5b9e\u73b0\u52a8\u753b\u7a81\u53d8\u79fb\u52a8\u6548\u679c\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 CSS \u5b9e\u73b0\u52a8\u753b\u7a81\u53d8\u79fb\u52a8\u6548\u679c\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u52a8\u753b\u7a81\u53d8\uff1a\u5b9e\u73b0\u7a81\u53d1\u79fb\u52a8\u6548\u679c<\/strong><\/p>\n<p>\u5728CSS\u52a8\u753b\u4e2d\uff0c\u5b9e\u73b0\u7a81\u53d8\u6548\u679c\u9700\u8981\u91c7\u7528\u7279\u6b8a\u7684\u7b56\u7565\u3002\u901a\u5e38\uff0c\u7528CSS keyframes\u5b9e\u73b0\u52a8\u753b\u7684\u79fb\u52a8\u6548\u679c\u662f\u5f88\u65b9\u4fbf\u7684\u3002\u4f46\u662f\uff0c\u5f53\u9700\u8981\u5b9e\u73b0\u7a81\u53d8\u79fb\u52a8\u65f6\uff0c\u6bd4\u5982\u7269\u4f53\u4ece\u67d0\u4e2a\u4f4d\u7f6e\u77ac\u95f4\u8df3\u5230\u53e6\u4e00\u4e2a\u4f4d\u7f6e\uff0c\u5c31\u9700\u8981\u4f7f\u7528\u8d1f\u7684\u52a8\u753b\u5ef6\u8fdf\u3002<\/p>\n<p>\u5177\u4f53\u6765\u8bb2\uff0c\u8981\u8ba9\u7269\u4f53\u4ece30%\u5904\u5f00\u59cb\u79fb\u52a8\u5230100%\uff0c\u518d\u4ece0\u5f00\u59cb\u79fb\u52a8\u523030%\uff0c\u800c\u4e0d\u589e\u52a0\u52a8\u753b\u6548\u679c\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u8d1f\u6570\u7684\u5ef6\u65f6\u5c5e\u6027\u3002\u4f8b\u5982\uff1a<\/p>\n<pre>&lt;div class=\"block\"&gt;&lt;\/div&gt;\n&lt;div class=\"block start3\"&gt;&lt;\/div&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<pre>@keyframes move {\n  0% { left: 0 }\n  100% { left: 100px }\n}\n\n.block { animation: 10s linear; }\n.start3 { animation-delay: -3s }<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u679c\u9700\u8981\u66f4\u590d\u6742\u7684\u7a81\u53d8\u52a8\u753b\uff0c\u5219\u9700\u8981\u5355\u72ec\u7f16\u5199\u52a8\u753b\uff0c\u65e0\u6cd5\u4f7f\u7528\u540c\u4e00\u4e2aCSS\u52a8\u753b\uff0c\u53ef\u4ee5\u7528\u4e0b\u9762\u8fd9\u79cd\u8def\u5f84\uff1a<\/p>\n<p>[\u56fe\u7247\u5730\u5740\uff1ahttps:\/\/segmentfault.com\/img\/bVc3utS]<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p>\u76f8\u5173\u9605\u8bfb\uff1a<\/p>\n<ul>\n<li>[animation-delay &#8211; CSS\uff08\u5c42\u53e0\u6837\u5f0f\u8868\uff09 | MDN](https:\/\/developer.mozilla.org\/zh-CN\/docs\/Web\/CSS\/animation-delay)<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 CSS \u5b9e\u73b0\u52a8\u753b\u7a81\u53d8\u79fb\u52a8\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\u7a81\u53d8\uff1a\u5b9e\u73b0\u7a81\u53d1\u79fb\u52a8\u6548\u679c \u5728CSS\u52a8\u753b\u4e2d\uff0c\u5b9e\u73b0\u7a81\u53d8\u6548\u679c\u9700\u8981\u91c7\u7528\u7279\u6b8a\u7684\u7b56\u7565\u3002\u901a\u5e38\uff0c\u7528CSS keyframes\u5b9e\u73b0\u52a8\u753b\u7684\u79fb\u52a8\u6548\u679c\u662f\u5f88\u65b9\u4fbf\u7684\u3002\u4f46\u662f\uff0c\u5f53\u9700\u8981\u5b9e\u73b0\u7a81\u53d8\u79fb\u52a8\u65f6\uff0c\u6bd4\u5982\u7269\u4f53\u4ece\u67d0\u4e2a\u4f4d\u7f6e\u77ac\u95f4\u8df3\u5230\u53e6\u4e00\u4e2a\u4f4d\u7f6e\uff0c\u5c31\u9700\u8981\u4f7f\u7528\u8d1f\u7684\u52a8\u753b\u5ef6\u8fdf\u3002 \u5177\u4f53\u6765\u8bb2\uff0c\u8981\u8ba9\u7269\u4f53\u4ece30%\u5904\u5f00\u59cb\u79fb\u52a8\u5230100%\uff0c\u518d\u4ece0\u5f00\u59cb\u79fb\u52a8\u523030%\uff0c\u800c\u4e0d\u589e\u52a0\u52a8\u753b\u6548\u679c\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u8d1f\u6570\u7684\u5ef6\u65f6\u5c5e\u6027\u3002\u4f8b\u5982\uff1a &lt;div class=&#8221;block&#8221;&gt;&lt;\/div&gt; &lt;div class=&#8221;block start3&#8243;&gt;&lt;\/div&gt; \u767b\u5f55\u540e\u590d\u5236 @keyframes move { 0% { left: 0 } 100% { left: 100px } } .block { animation: 10s linear; } .start3 { animation-delay: -3s } \u767b\u5f55\u540e\u590d\u5236 \u5982\u679c\u9700\u8981\u66f4\u590d\u6742\u7684\u7a81\u53d8\u52a8\u753b\uff0c\u5219\u9700\u8981\u5355\u72ec\u7f16\u5199\u52a8\u753b\uff0c\u65e0\u6cd5\u4f7f\u7528\u540c\u4e00\u4e2aCSS\u52a8\u753b\uff0c\u53ef\u4ee5\u7528\u4e0b\u9762\u8fd9\u79cd\u8def\u5f84\uff1a [\u56fe\u7247\u5730\u5740\uff1ahttps:\/\/segmentfault.com\/img\/bVc3utS] \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u76f8\u5173\u9605\u8bfb\uff1a [animation-delay &#8211; CSS\uff08\u5c42\u53e0\u6837\u5f0f\u8868\uff09 | MDN](https:\/\/developer.mozilla.org\/zh-CN\/docs\/Web\/CSS\/animation-delay) \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 CSS \u5b9e\u73b0\u52a8\u753b\u7a81\u53d8\u79fb\u52a8\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},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-1283","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1283","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=1283"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1283\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=1283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=1283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=1283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}