{"id":1150,"date":"2024-07-27T19:00:53","date_gmt":"2024-07-27T11:00:53","guid":{"rendered":"http:\/\/codermr.com\/?p=1150"},"modified":"2024-07-27T19:29:17","modified_gmt":"2024-07-27T11:29:17","slug":"css_article6","status":"publish","type":"post","link":"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/","title":{"rendered":"CSS \u57fa\u7840\uff08\u516d\uff09\uff1a\u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u3001\u52a8\u753b"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">\u81ea\u5b9a\u4e49\u7ec4\u4ef6<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u7684\u539f\u7406<\/h2>\n\n\n\n<p><strong>\u5148\u8bf4\u4e2a\u524d\u7f6e\u77e5\u8bc6\u70b9\uff0c\u60f3\u60f3\u4e0b\u9762\u8fd9\u4e2a CSS \u662f\u4ec0\u4e48\u610f\u601d\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.dropdown:hover .dropdown-content {\n  display: block;\n}<\/code><\/pre>\n\n\n\n<p>The CSS style you provided is a simple rule that changes the display property of an element with the class <code>.dropdown-content<\/code> when its parent (or ancestor) element with the class <code>.dropdown<\/code> is hovered over.<\/p>\n\n\n\n<p>The CSS style you provided means that when an element with the class <code>.dropdown<\/code> is hovered over, any child element with the class <code>.dropdown-content<\/code> will be displayed.<\/p>\n\n\n\n<p>\u5f53\u67d0\u4e2a\u5177\u6709 .dropdown:hover \u6837\u5f0f\u7684\u7236\u6807\u7b7e\u5728\u9f20\u6807\u60ac\u505c\u5176\u4e0a\u9762\u65f6\uff0c\u8be5\u7236\u6807\u7b7e\u4e0b\u5177\u6709 <code>.dropdown-content<\/code> \u6837\u5f0f\u7684\u5b50\u6807\u7b7e\u7684\u6837\u5f0f\u662f display: block; <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Explanation:<\/h3>\n\n\n\n<ol>\n<li><strong><code>.dropdown:hover<\/code><\/strong>: This part of the selector targets elements with the class <code>.dropdown<\/code> when they are being hovered over by the mouse pointer. Hovering is when the mouse pointer is placed over an element without clicking it.<\/li>\n\n\n\n<li><strong><code>.dropdown .dropdown-content<\/code><\/strong>: This part of the selector targets elements with the class <code>.dropdown-content<\/code> that are descendants of elements with the class <code>.dropdown<\/code>.<\/li>\n\n\n\n<li><strong><code>display: block;<\/code><\/strong>: This rule changes the <code>display<\/code> property of the <code>.dropdown-content<\/code> element to <code>block<\/code>. By default, many dropdown content elements are hidden (e.g., <code>display: none;<\/code>) to prevent them from being displayed until needed. Setting <code>display<\/code> to <code>block<\/code> makes the element visible.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Combined Meaning:<\/h3>\n\n\n\n<p>When an element with the class <code>.dropdown<\/code> is hovered over, any descendant element with the class <code>.dropdown-content<\/code> will have its <code>display<\/code> property set to <code>block<\/code>. This typically means that the dropdown content, which is initially hidden, will become visible when the user hovers over the dropdown element.<\/p>\n\n\n\n<p>\u4e0b\u9762\u5f00\u59cb\u5b9e\u73b0\u81ea\u5b9a\u4e49\u4e0b\u62c9\u5217\u8868\uff0c\u5f53\u9f20\u6807\u79fb\u52a8\u5230\u6307\u5b9a\u5143\u7d20\u4e0a\u65f6\uff0c\u4f1a\u51fa\u73b0\u4e0b\u62c9\u83dc\u5355\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html>\n&lt;html>\n\n&lt;head>\n    &lt;meta charset=\"utf-8\">\n    &lt;style>\n        .dropdown {\n            position: relative;\n            display: inline-block;\n        }\n\n        .dropdown-content {\n            display: none;\n            position: absolute;\n            background-color: #f9f9f9;\n            min-width: 160px;\n            box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);\n            padding: 12px 16px;\n        }\n\n        .dropdown:hover .dropdown-content {\n            display: block;\n        }\n    &lt;\/style>\n&lt;\/head>\n\n&lt;body>\n\n    &lt;h2>\u9f20\u6807\u79fb\u52a8\u540e\u51fa\u73b0\u4e0b\u62c9\u83dc\u5355&lt;\/h2>\n    &lt;p>\u5c06\u9f20\u6807\u79fb\u52a8\u5230\u6307\u5b9a\u5143\u7d20\u4e0a\u5c31\u80fd\u770b\u5230\u4e0b\u62c9\u83dc\u5355\u3002&lt;\/p>\n    \n    &lt;!-- \u4f7f\u7528 .dropdown \u8bbe\u7f6e\u4e86\u8be5div\u662f\u4ee5\u5185\u8054\u5143\u7d20\u7684\u5f62\u5f0f\u663e\u793a\uff0c\u5373\u4e0d\u6362\u884c\u4e86\u3002 -->\n    &lt;div class=\"dropdown\">\n        &lt;span>\u9f20\u6807\u79fb\u52a8\u5230\u6211\u8fd9\uff01&lt;\/span>\n        &lt;div class=\"dropdown-content\">\n            &lt;p>\u9009\u98791&lt;\/p>\n            &lt;p>\u9009\u98792&lt;\/p>\n        &lt;\/div>\n    &lt;\/div>\n\n&lt;\/body>\n\n&lt;\/html><\/code><\/pre>\n\n\n\n<p><strong>\u663e\u793a\u6548\u679c\uff1a<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/codermr.com\/wp-content\/uploads\/2024\/07\/image-46.png\"><img loading=\"lazy\" decoding=\"async\" width=\"347\" height=\"448\" src=\"http:\/\/codermr.com\/wp-content\/uploads\/2024\/07\/image-46.png\" alt=\"\" class=\"wp-image-1152\" srcset=\"http:\/\/codermr.com\/wp-content\/uploads\/2024\/07\/image-46.png 347w, http:\/\/codermr.com\/wp-content\/uploads\/2024\/07\/image-46-232x300.png 232w\" sizes=\"(max-width: 347px) 100vw, 347px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u4f8b\u89e3\u6790<\/h3>\n\n\n\n<p><strong>HTML \u90e8\u5206\uff1a<\/strong><\/p>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u7684 HTML \u5143\u7d20\u6765\u6253\u5f00\u4e0b\u62c9\u83dc\u5355\uff0c\u5982\uff1a&lt;span&gt;, \u6216 a &lt;button&gt; \u5143\u7d20\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528\u5bb9\u5668\u5143\u7d20 (\u5982\uff1a &lt;div&gt;) \u6765\u521b\u5efa\u4e0b\u62c9\u83dc\u5355\u7684\u5185\u5bb9\uff0c\u5e76\u653e\u5728\u4efb\u4f55\u4f60\u60f3\u653e\u7684\u4f4d\u7f6e\u4e0a\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528 &lt;div&gt; \u5143\u7d20\u6765\u5305\u88f9\u8fd9\u4e9b\u5143\u7d20\uff0c\u5e76\u4f7f\u7528 CSS \u6765\u8bbe\u7f6e\u4e0b\u62c9\u5185\u5bb9\u7684\u6837\u5f0f\u3002<\/p>\n\n\n\n<p><strong>CSS \u90e8\u5206\uff1a<\/strong><\/p>\n\n\n\n<p><code>.dropdown<\/code>&nbsp;\u7c7b\u4f7f\u7528&nbsp;<code>position:relative<\/code>, \u8fd9\u5c06\u8bbe\u7f6e\u4e0b\u62c9\u83dc\u5355\u7684\u5185\u5bb9\u653e\u7f6e\u5728\u4e0b\u62c9\u6309\u94ae (\u4f7f\u7528&nbsp;<code>position:absolute<\/code>) \u7684\u53f3\u4e0b\u89d2\u4f4d\u7f6e\u3002<\/p>\n\n\n\n<p><code>.dropdown-content<\/code>&nbsp;\u7c7b\u4e2d\u662f\u5b9e\u9645\u7684\u4e0b\u62c9\u83dc\u5355\u3002\u9ed8\u8ba4\u662f\u9690\u85cf\u7684\uff0c\u5728\u9f20\u6807\u79fb\u52a8\u5230\u6307\u5b9a\u5143\u7d20\u540e\u4f1a\u663e\u793a\u3002 \u6ce8\u610f&nbsp;<code>min-width<\/code>&nbsp;\u7684\u503c\u8bbe\u7f6e\u4e3a 160px\u3002\u4f60\u53ef\u4ee5\u968f\u610f\u4fee\u6539\u5b83\u3002&nbsp;<strong>\u6ce8\u610f:<\/strong>&nbsp;\u5982\u679c\u4f60\u60f3\u8bbe\u7f6e\u4e0b\u62c9\u5185\u5bb9\u4e0e\u4e0b\u62c9\u6309\u94ae\u7684\u5bbd\u5ea6\u4e00\u81f4\uff0c\u53ef\u8bbe\u7f6e&nbsp;<code>width<\/code>&nbsp;\u4e3a 100% (&nbsp;<code>overflow:auto<\/code>&nbsp;\u8bbe\u7f6e\u53ef\u4ee5\u5728\u5c0f\u5c3a\u5bf8\u5c4f\u5e55\u4e0a\u6eda\u52a8)\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u4f7f\u7528&nbsp;<code>box-shadow<\/code>&nbsp;\u5c5e\u6027\u8ba9\u4e0b\u62c9\u83dc\u5355\u770b\u8d77\u6765\u50cf\u4e00\u4e2a&#8221;\u5361\u7247&#8221;\u3002<\/p>\n\n\n\n<p><code>:hover<\/code>&nbsp;\u9009\u62e9\u5668\u7528\u4e8e\u5728\u7528\u6237\u5c06\u9f20\u6807\u79fb\u52a8\u5230\u4e0b\u62c9\u6309\u94ae\u4e0a\u65f6\u663e\u793a\u4e0b\u62c9\u83dc\u5355\u3002<\/p>\n\n\n\n<p>\u53c2\uff1a<br><a href=\"https:\/\/www.runoob.com\/css\/css-dropdowns.html\">https:\/\/www.runoob.com\/css\/css-dropdowns.html<\/a><br><a href=\"https:\/\/www.runoob.com\/try\/try.php?filename=trycss_dropdown_button\">https:\/\/www.runoob.com\/try\/try.php?filename=trycss_dropdown_button<\/a><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">CSS3\u00a0\u52a8\u753b<\/h1>\n\n\n\n<p>CSS3 \u53ef\u4ee5\u521b\u5efa\u52a8\u753b\uff0c\u5b83\u53ef\u4ee5\u53d6\u4ee3\u8bb8\u591a\u7f51\u9875\u52a8\u753b\u56fe\u50cf\u3001Flash \u52a8\u753b\u548c JavaScript \u5b9e\u73b0\u7684\u6548\u679c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">CSS3 @keyframes \u89c4\u5219<\/h2>\n\n\n\n<p>\u8981\u521b\u5efa CSS3 \u52a8\u753b\uff0c\u4f60\u9700\u8981\u4e86\u89e3 @keyframes \u89c4\u5219\u3002<\/p>\n\n\n\n<p>@keyframes \u89c4\u5219\u662f\u521b\u5efa\u52a8\u753b\u3002<\/p>\n\n\n\n<p>@keyframes \u89c4\u5219\u5185\u6307\u5b9a\u4e00\u4e2a CSS \u6837\u5f0f\u548c\u52a8\u753b\u5c06\u9010\u6b65\u4ece\u76ee\u524d\u7684\u6837\u5f0f\u66f4\u6539\u4e3a\u65b0\u7684\u6837\u5f0f<\/p>\n\n\n\n<p>\u5f53\u5728&nbsp;<strong>@keyframes<\/strong>&nbsp;\u521b\u5efa\u52a8\u753b\uff0c\u628a\u5b83\u7ed1\u5b9a\u5230\u4e00\u4e2a\u9009\u62e9\u5668\uff0c\u5426\u5219\u52a8\u753b\u4e0d\u4f1a\u6709\u4efb\u4f55\u6548\u679c\u3002<\/p>\n\n\n\n<p>\u6307\u5b9a\u81f3\u5c11\u8fd9\u4e24\u4e2aCSS3\u7684\u52a8\u753b\u5c5e\u6027\u7ed1\u5b9a\u5411\u4e00\u4e2a\u9009\u62e9\u5668\uff1a<\/p>\n\n\n\n<ul>\n<li>\u89c4\u5b9a\u52a8\u753b\u7684\u540d\u79f0<\/li>\n\n\n\n<li>\u89c4\u5b9a\u52a8\u753b\u7684\u65f6\u957f<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>div\n{\n    animation: myfirst 5s;\n    -webkit-animation: myfirst 5s; \/* Safari \u4e0e Chrome *\/\n}<\/code><\/pre>\n\n\n\n<p><strong>\u6ce8\u610f:\u00a0<\/strong>\u60a8\u5fc5\u987b\u5b9a\u4e49\u52a8\u753b\u7684\u540d\u79f0\u548c\u52a8\u753b\u7684\u6301\u7eed\u65f6\u95f4\u3002\u5982\u679c\u7701\u7565\u7684\u6301\u7eed\u65f6\u95f4\uff0c\u52a8\u753b\u5c06\u65e0\u6cd5\u8fd0\u884c\uff0c\u56e0\u4e3a\u9ed8\u8ba4\u503c\u662f0\u3002<\/p>\n\n\n\n<p><strong>\u52a8\u753b\u4f8b\u5b50\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html>\n&lt;html>\n&lt;head>\n&lt;meta charset=\"utf-8\"> \n&lt;style> \ndiv\n{\n\twidth:100px;\n\theight:100px;\n\tbackground:red;\n\tanimation:myfirst 5s;\n\t-webkit-animation:myfirst 5s; \/* Safari and Chrome *\/\n}\n\n@keyframes myfirst\n{\n\tfrom {background:red;}\n\tto {background:yellow;}\n}\n\n@-webkit-keyframes myfirst \/* Safari and Chrome *\/\n{\n\tfrom {background:red;}\n\tto {background:yellow;}\n}\n&lt;\/style>\n&lt;\/head>\n&lt;body>\n\n&lt;p>&lt;b>\u6ce8\u610f:&lt;\/b> \u8be5\u5b9e\u4f8b\u5728 Internet Explorer 9 \u53ca\u66f4\u65e9 IE \u7248\u672c\u662f\u65e0\u6548\u7684\u3002&lt;\/p>\n\n&lt;div>&lt;\/div>\n\n&lt;\/body>\n&lt;\/html><\/code><\/pre>\n\n\n\n<p><strong>\u52a8\u753b\u6548\u679c\uff1a<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls muted src=\"http:\/\/codermr.com\/wp-content\/uploads\/2024\/07\/css\u52a8\u753b01.mp4\"><\/video><\/figure>\n\n\n\n<p>\u53c2\uff1a<a href=\"https:\/\/www.runoob.com\/try\/try.php?filename=trycss3_animation1\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.runoob.com\/try\/try.php?filename=trycss3_animation1<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">CSS3\u52a8\u753b\u662f\u4ec0\u4e48\uff1f<\/h2>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">\u52a8\u753b\u662f\u4f7f\u5143\u7d20\u4ece\u4e00\u79cd\u6837\u5f0f\u9010\u6e10\u53d8\u5316\u4e3a\u53e6\u4e00\u79cd\u6837\u5f0f\u7684\u6548\u679c\u3002<\/mark><\/strong><\/p>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u6539\u53d8\u4efb\u610f\u591a\u7684\u6837\u5f0f\u4efb\u610f\u591a\u7684\u6b21\u6570\u3002<\/p>\n\n\n\n<p>\u8bf7\u7528\u767e\u5206\u6bd4\u6765\u89c4\u5b9a\u53d8\u5316\u53d1\u751f\u7684\u65f6\u95f4\uff0c\u6216\u7528\u5173\u952e\u8bcd &#8220;from&#8221; \u548c &#8220;to&#8221;\uff0c\u7b49\u540c\u4e8e 0% \u548c 100%\u3002<\/p>\n\n\n\n<p>0% \u662f\u52a8\u753b\u7684\u5f00\u59cb\uff0c100% \u662f\u52a8\u753b\u7684\u5b8c\u6210\u3002<\/p>\n\n\n\n<p>\u4e3a\u4e86\u5f97\u5230\u6700\u4f73\u7684\u6d4f\u89c8\u5668\u652f\u6301\uff0c\u60a8\u5e94\u8be5\u59cb\u7ec8\u5b9a\u4e49 0% \u548c 100% \u9009\u62e9\u5668\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u4f8b<\/h3>\n\n\n\n<p>\u5f53\u52a8\u753b\u4e3a 25% \u53ca 50% \u65f6\u6539\u53d8\u80cc\u666f\u8272\uff0c\u7136\u540e\u5f53\u52a8\u753b 100% \u5b8c\u6210\u65f6\u518d\u6b21\u6539\u53d8\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@keyframes myfirst\n{\n    0%   {background: red;}\n    25%  {background: yellow;}\n    50%  {background: blue;}\n    100% {background: green;}\n}\n \n@-webkit-keyframes myfirst \/* Safari \u4e0e Chrome *\/\n{\n    0%   {background: red;}\n    25%  {background: yellow;}\n    50%  {background: blue;}\n    100% {background: green;}\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u4f8b<\/h3>\n\n\n\n<p>\u6539\u53d8\u80cc\u666f\u8272\u548c\u4f4d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@keyframes myfirst\n{\n    0%   {background: red; left:0px; top:0px;}\n    25%  {background: yellow; left:200px; top:0px;}\n    50%  {background: blue; left:200px; top:200px;}\n    75%  {background: green; left:0px; top:200px;}\n    100% {background: red; left:0px; top:0px;}\n}\n \n@-webkit-keyframes myfirst \/* Safari \u4e0e Chrome *\/\n{\n    0%   {background: red; left:0px; top:0px;}\n    25%  {background: yellow; left:200px; top:0px;}\n    50%  {background: blue; left:200px; top:200px;}\n    75%  {background: green; left:0px; top:200px;}\n    100% {background: red; left:0px; top:0px;}\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">CSS3\u7684\u52a8\u753b\u5c5e\u6027<\/h2>\n\n\n\n<p>\u4e0b\u9762\u7684\u8868\u683c\u5217\u51fa\u4e86 @keyframes \u89c4\u5219\u548c\u6240\u6709\u52a8\u753b\u5c5e\u6027\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>\u5c5e\u6027<\/th><th>\u63cf\u8ff0<\/th><th>CSS<\/th><\/tr><tr><td><a href=\"https:\/\/www.runoob.com\/cssref\/css3-pr-animation-keyframes.html\">@keyframes<\/a><\/td><td>\u89c4\u5b9a\u52a8\u753b\u3002<\/td><td>3<\/td><\/tr><tr><td><a href=\"https:\/\/www.runoob.com\/cssref\/css3-pr-animation.html\">animation<\/a><\/td><td>\u6240\u6709\u52a8\u753b\u5c5e\u6027\u7684\u7b80\u5199\u5c5e\u6027\u3002<\/td><td>3<\/td><\/tr><tr><td><a href=\"https:\/\/www.runoob.com\/cssref\/css3-pr-animation-name.html\">animation-name<\/a><\/td><td>\u89c4\u5b9a @keyframes \u52a8\u753b\u7684\u540d\u79f0\u3002<\/td><td>3<\/td><\/tr><tr><td><a href=\"https:\/\/www.runoob.com\/cssref\/css3-pr-animation-duration.html\">animation-duration<\/a><\/td><td>\u89c4\u5b9a\u52a8\u753b\u5b8c\u6210\u4e00\u4e2a\u5468\u671f\u6240\u82b1\u8d39\u7684\u79d2\u6216\u6beb\u79d2\u3002\u9ed8\u8ba4\u662f 0\u3002<\/td><td>3<\/td><\/tr><tr><td><a href=\"https:\/\/www.runoob.com\/cssref\/css3-pr-animation-timing-function.html\">animation-timing-function<\/a><\/td><td>\u89c4\u5b9a\u52a8\u753b\u7684\u901f\u5ea6\u66f2\u7ebf\u3002\u9ed8\u8ba4\u662f &#8220;ease&#8221;\u3002<\/td><td>3<\/td><\/tr><tr><td><a href=\"https:\/\/www.runoob.com\/cssref\/css3-pr-animation-fill-mode.html\">animation-fill-mode<\/a><\/td><td>\u89c4\u5b9a\u5f53\u52a8\u753b\u4e0d\u64ad\u653e\u65f6\uff08\u5f53\u52a8\u753b\u5b8c\u6210\u65f6\uff0c\u6216\u5f53\u52a8\u753b\u6709\u4e00\u4e2a\u5ef6\u8fdf\u672a\u5f00\u59cb\u64ad\u653e\u65f6\uff09\uff0c\u8981\u5e94\u7528\u5230\u5143\u7d20\u7684\u6837\u5f0f\u3002<\/td><td>3<\/td><\/tr><tr><td><a href=\"https:\/\/www.runoob.com\/cssref\/css3-pr-animation-delay.html\">animation-delay<\/a><\/td><td>\u89c4\u5b9a\u52a8\u753b\u4f55\u65f6\u5f00\u59cb\u3002\u9ed8\u8ba4\u662f 0\u3002<\/td><td>3<\/td><\/tr><tr><td><a href=\"https:\/\/www.runoob.com\/cssref\/css3-pr-animation-iteration-count.html\">animation-iteration-count<\/a><\/td><td>\u89c4\u5b9a\u52a8\u753b\u88ab\u64ad\u653e\u7684\u6b21\u6570\u3002\u9ed8\u8ba4\u662f 1\u3002<\/td><td>3<\/td><\/tr><tr><td><a href=\"https:\/\/www.runoob.com\/cssref\/css3-pr-animation-direction.html\">animation-direction<\/a><\/td><td>\u89c4\u5b9a\u52a8\u753b\u662f\u5426\u5728\u4e0b\u4e00\u5468\u671f\u9006\u5411\u5730\u64ad\u653e\u3002\u9ed8\u8ba4\u662f &#8220;normal&#8221;\u3002<\/td><td>3<\/td><\/tr><tr><td><a href=\"https:\/\/www.runoob.com\/cssref\/css3-pr-animation-play-state.html\">animation-play-state<\/a><\/td><td>\u89c4\u5b9a\u52a8\u753b\u662f\u5426\u6b63\u5728\u8fd0\u884c\u6216\u6682\u505c\u3002\u9ed8\u8ba4\u662f &#8220;running&#8221;\u3002<\/td><td>3<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">\u53c2\uff1a<a href=\"https:\/\/www.runoob.com\/css3\/css3-animations.html\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.runoob.com\/css3\/css3-animations.html<\/a><\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u52a8\u753b\u793a\u4f8b<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html>\n&lt;html>\n&lt;head>\n&lt;meta charset=\"utf-8\"> \n&lt;title>\u83dc\u9e1f\u6559\u7a0b(runoob.com)&lt;\/title>\n&lt;style> \ndiv\n{\n\twidth:100px;\n\theight:100px;\n\tbackground:red;\n\tposition:relative;\n\tanimation:myfirst 5s linear 2s infinite alternate;\n\t\/* Firefox: *\/\n\t-moz-animation:myfirst 5s linear 2s infinite alternate;\n\t\/* Safari and Chrome: *\/\n\t-webkit-animation:myfirst 5s linear 2s infinite alternate;\n\t\/* Opera: *\/\n\t-o-animation:myfirst 5s linear 2s infinite alternate;\n}\n\n@keyframes myfirst\n{\n\t0%   {background:red; left:0px; top:0px;}\n\t25%  {background:yellow; left:200px; top:0px;}\n\t50%  {background:blue; left:200px; top:200px;}\n\t75%  {background:green; left:0px; top:200px;}\n\t100% {background:red; left:0px; top:0px;}\n}\n\n@-moz-keyframes myfirst \/* Firefox *\/\n{\n\t0%   {background:red; left:0px; top:0px;}\n\t25%  {background:yellow; left:200px; top:0px;}\n\t50%  {background:blue; left:200px; top:200px;}\n\t75%  {background:green; left:0px; top:200px;}\n\t100% {background:red; left:0px; top:0px;}\n}\n\n@-webkit-keyframes myfirst \/* Safari and Chrome *\/\n{\n\t0%   {background:red; left:0px; top:0px;}\n\t25%  {background:yellow; left:200px; top:0px;}\n\t50%  {background:blue; left:200px; top:200px;}\n\t75%  {background:green; left:0px; top:200px;}\n\t100% {background:red; left:0px; top:0px;}\n}\n\n@-o-keyframes myfirst \/* Opera *\/\n{\n\t0%   {background:red; left:0px; top:0px;}\n\t25%  {background:yellow; left:200px; top:0px;}\n\t50%  {background:blue; left:200px; top:200px;}\n\t75%  {background:green; left:0px; top:200px;}\n\t100% {background:red; left:0px; top:0px;}\n}\n&lt;\/style>\n&lt;\/head>\n&lt;body>\n\n&lt;p>&lt;b>\u6ce8\u610f:&lt;\/b> \u8be5\u5b9e\u4f8b\u5728 Internet Explorer 9 \u53ca\u66f4\u65e9 IE \u7248\u672c\u662f\u65e0\u6548\u7684\u3002&lt;\/p>\n\n&lt;div>&lt;\/div>\n\n&lt;\/body>\n&lt;\/html><\/code><\/pre>\n\n\n\n<p><strong>\u52a8\u753b\u6548\u679c\uff1a<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls muted src=\"http:\/\/codermr.com\/wp-content\/uploads\/2024\/07\/css\u52a8\u753b02.mp4\"><\/video><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u81ea\u5b9a\u4e49\u7ec4\u4ef6 \u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u7684\u539f\u7406 \u5148\u8bf4\u4e2a\u524d\u7f6e\u77e5\u8bc6\u70b9\uff0c\u60f3\u60f3\u4e0b\u9762\u8fd9\u4e2a CSS \u662f\u4ec0\u4e48\u610f\u601d\uff1a The CSS sty&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1153,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[61],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CSS \u57fa\u7840\uff08\u516d\uff09\uff1a\u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u3001\u52a8\u753b - \u7801\u5148\u751f\u7684\u535a\u5ba2<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CSS \u57fa\u7840\uff08\u516d\uff09\uff1a\u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u3001\u52a8\u753b - \u7801\u5148\u751f\u7684\u535a\u5ba2\" \/>\n<meta property=\"og:description\" content=\"\u81ea\u5b9a\u4e49\u7ec4\u4ef6 \u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u7684\u539f\u7406 \u5148\u8bf4\u4e2a\u524d\u7f6e\u77e5\u8bc6\u70b9\uff0c\u60f3\u60f3\u4e0b\u9762\u8fd9\u4e2a CSS \u662f\u4ec0\u4e48\u610f\u601d\uff1a The CSS sty...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/\" \/>\n<meta property=\"og:site_name\" content=\"\u7801\u5148\u751f\u7684\u535a\u5ba2\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-27T11:00:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-27T11:29:17+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/codermr.com\/wp-content\/uploads\/2024\/07\/css5.png\" \/>\n\t<meta property=\"og:image:width\" content=\"490\" \/>\n\t<meta property=\"og:image:height\" content=\"488\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"\u7801\u5148\u751f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/mrcode2021\" \/>\n<meta name=\"twitter:site\" content=\"@mrcode2021\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u7801\u5148\u751f\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/\"},\"author\":{\"name\":\"\u7801\u5148\u751f\",\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf\"},\"headline\":\"CSS \u57fa\u7840\uff08\u516d\uff09\uff1a\u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u3001\u52a8\u753b\",\"datePublished\":\"2024-07-27T11:00:53+00:00\",\"dateModified\":\"2024-07-27T11:29:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/\"},\"wordCount\":298,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf\"},\"keywords\":[\"html_css_js\"],\"articleSection\":[\"\u524d\u7aef\u6280\u672f\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/\",\"url\":\"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/\",\"name\":\"CSS \u57fa\u7840\uff08\u516d\uff09\uff1a\u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u3001\u52a8\u753b - \u7801\u5148\u751f\u7684\u535a\u5ba2\",\"isPartOf\":{\"@id\":\"http:\/\/codermr.com\/#website\"},\"datePublished\":\"2024-07-27T11:00:53+00:00\",\"dateModified\":\"2024-07-27T11:29:17+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"http:\/\/codermr.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSS \u57fa\u7840\uff08\u516d\uff09\uff1a\u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u3001\u52a8\u753b\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/codermr.com\/#website\",\"url\":\"http:\/\/codermr.com\/\",\"name\":\"\u7801\u5148\u751f\u7684\u535a\u5ba2\",\"description\":\"\u6b22 \u8fce \u4e0b \u8f7d \u6211 \u5f00 \u53d1 \u7684 \u5404 \u7aef \u8f6f \u4ef6 \u548c APP\",\"publisher\":{\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/codermr.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf\",\"name\":\"\u7801\u5148\u751f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/wukong.jpg\",\"contentUrl\":\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/wukong.jpg\",\"width\":400,\"height\":400,\"caption\":\"\u7801\u5148\u751f\"},\"logo\":{\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/codermr.com\",\"https:\/\/twitter.com\/https:\/\/twitter.com\/mrcode2021\"],\"url\":\"http:\/\/codermr.com\/index.php\/author\/coderma\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CSS \u57fa\u7840\uff08\u516d\uff09\uff1a\u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u3001\u52a8\u753b - \u7801\u5148\u751f\u7684\u535a\u5ba2","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/","og_locale":"zh_CN","og_type":"article","og_title":"CSS \u57fa\u7840\uff08\u516d\uff09\uff1a\u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u3001\u52a8\u753b - \u7801\u5148\u751f\u7684\u535a\u5ba2","og_description":"\u81ea\u5b9a\u4e49\u7ec4\u4ef6 \u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u7684\u539f\u7406 \u5148\u8bf4\u4e2a\u524d\u7f6e\u77e5\u8bc6\u70b9\uff0c\u60f3\u60f3\u4e0b\u9762\u8fd9\u4e2a CSS \u662f\u4ec0\u4e48\u610f\u601d\uff1a The CSS sty...","og_url":"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/","og_site_name":"\u7801\u5148\u751f\u7684\u535a\u5ba2","article_published_time":"2024-07-27T11:00:53+00:00","article_modified_time":"2024-07-27T11:29:17+00:00","og_image":[{"width":490,"height":488,"url":"http:\/\/codermr.com\/wp-content\/uploads\/2024\/07\/css5.png","type":"image\/png"}],"author":"\u7801\u5148\u751f","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/mrcode2021","twitter_site":"@mrcode2021","twitter_misc":{"\u4f5c\u8005":"\u7801\u5148\u751f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/#article","isPartOf":{"@id":"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/"},"author":{"name":"\u7801\u5148\u751f","@id":"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf"},"headline":"CSS \u57fa\u7840\uff08\u516d\uff09\uff1a\u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u3001\u52a8\u753b","datePublished":"2024-07-27T11:00:53+00:00","dateModified":"2024-07-27T11:29:17+00:00","mainEntityOfPage":{"@id":"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/"},"wordCount":298,"commentCount":0,"publisher":{"@id":"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf"},"keywords":["html_css_js"],"articleSection":["\u524d\u7aef\u6280\u672f"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/","url":"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/","name":"CSS \u57fa\u7840\uff08\u516d\uff09\uff1a\u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u3001\u52a8\u753b - \u7801\u5148\u751f\u7684\u535a\u5ba2","isPartOf":{"@id":"http:\/\/codermr.com\/#website"},"datePublished":"2024-07-27T11:00:53+00:00","dateModified":"2024-07-27T11:29:17+00:00","breadcrumb":{"@id":"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/codermr.com\/index.php\/2024\/07\/27\/css_article6\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/codermr.com\/"},{"@type":"ListItem","position":2,"name":"CSS \u57fa\u7840\uff08\u516d\uff09\uff1a\u81ea\u5b9a\u4e49\u4e0b\u62c9\u83dc\u5355\u3001\u52a8\u753b"}]},{"@type":"WebSite","@id":"http:\/\/codermr.com\/#website","url":"http:\/\/codermr.com\/","name":"\u7801\u5148\u751f\u7684\u535a\u5ba2","description":"\u6b22 \u8fce \u4e0b \u8f7d \u6211 \u5f00 \u53d1 \u7684 \u5404 \u7aef \u8f6f \u4ef6 \u548c APP","publisher":{"@id":"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/codermr.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf","name":"\u7801\u5148\u751f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/codermr.com\/#\/schema\/person\/image\/","url":"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/wukong.jpg","contentUrl":"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/wukong.jpg","width":400,"height":400,"caption":"\u7801\u5148\u751f"},"logo":{"@id":"http:\/\/codermr.com\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/codermr.com","https:\/\/twitter.com\/https:\/\/twitter.com\/mrcode2021"],"url":"http:\/\/codermr.com\/index.php\/author\/coderma\/"}]}},"_links":{"self":[{"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/posts\/1150"}],"collection":[{"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/comments?post=1150"}],"version-history":[{"count":3,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/posts\/1150\/revisions"}],"predecessor-version":[{"id":1170,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/posts\/1150\/revisions\/1170"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/media\/1153"}],"wp:attachment":[{"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/media?parent=1150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/categories?post=1150"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/tags?post=1150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}