{"id":3396,"date":"2024-11-10T08:38:33","date_gmt":"2024-11-10T00:38:33","guid":{"rendered":"https:\/\/fwq.ai\/blog\/3396\/"},"modified":"2024-11-10T08:38:33","modified_gmt":"2024-11-10T00:38:33","slug":"%e7%bd%91%e9%a1%b5%e8%ae%be%e8%ae%a1%e5%a4%a7%e7%a5%9e%ef%bc%8c%e5%a6%82%e4%bd%95%e7%94%a8css%e5%ae%9e%e7%8e%b0%e8%81%9a%e5%85%89%e7%81%af%e6%91%87%e6%91%86%e5%92%8c%e7%bf%bb%e9%a1%b5%e6%95%88","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/3396\/","title":{"rendered":"\u7f51\u9875\u8bbe\u8ba1\u5927\u795e\uff0c\u5982\u4f55\u7528CSS\u5b9e\u73b0\u805a\u5149\u706f\u6447\u6446\u548c\u7ffb\u9875\u6548\u679c\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173103661281605.jpg\" class=\"aligncenter\" title=\"\u7f51\u9875\u8bbe\u8ba1\u5927\u795e\uff0c\u5982\u4f55\u7528CSS\u5b9e\u73b0\u805a\u5149\u706f\u6447\u6446\u548c\u7ffb\u9875\u6548\u679c\uff1f\u63d2\u56fe\" alt=\"\u7f51\u9875\u8bbe\u8ba1\u5927\u795e\uff0c\u5982\u4f55\u7528CSS\u5b9e\u73b0\u805a\u5149\u706f\u6447\u6446\u548c\u7ffb\u9875\u6548\u679c\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u8bf7\u6559\u7f51\u9875\u8bbe\u8ba1\u5927\u795e\uff1a\u7ffb\u9875\u548c\u805a\u5149\u706f\u6548\u679c\u7684\u5b9e\u73b0<\/strong><\/p>\n<p>\u4e00\u4f4d\u8bbe\u8ba1\u5e08\u8bf7\u6559\u5927\u795e\u6709\u5173\u7f51\u9875\u4e2d\u7ffb\u9875\u548c\u805a\u5149\u706f\u6548\u679c\u7684\u5b9e\u73b0\u3002\u63d0\u4f9b\u7684\u7f51\u9875\u5c55\u793a\u4e86\u8fd9\u4e24\u4e2a\u6548\u679c\u3002<\/p>\n<p><strong>\u95ee\u9898\uff1a<\/strong><\/p>\n<p>\u8fd9\u4f4d\u8bbe\u8ba1\u5e08\u60f3\u8981\u4e86\u89e3\uff0c\u7f51\u9875\u4e2d\u5c55\u793a\u7684\u805a\u5149\u706f\u548c\u7ffb\u9875\u6548\u679c\u662f\u5982\u4f55\u4f7f\u7528 javascript \u5b9e\u73b0\u7684\u3002<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p><strong>\u7b54\u6848\uff1a<\/strong><\/p>\n<p>\u8ba9\u4eba\u60ca\u8bb6\u7684\u662f\uff0c\u8fd9\u4e24\u79cd\u6548\u679c\u5e76\u4e0d\u9700\u8981 javascript \u5c31\u80fd\u5b9e\u73b0\u3002<\/p>\n<ul>\n<li> <strong>\u805a\u5149\u706f\u6548\u679c\uff1a<\/strong>\u4f7f\u7528 3 \u4e2d\u7684\u52a8\u753b\u5c5e\u6027\u5b9e\u73b0\u4e86\u6447\u6446\u6548\u679c\u3002<\/li>\n<li> <strong>\u7ffb\u9875\u6548\u679c\uff1a<\/strong>\u901a\u8fc7\u5b9a\u4f4d\u5b9e\u73b0\u4e86\uff0c\u5176\u539f\u7406\u4e0e\u8f6e\u64ad\u56fe\u7c7b\u4f3c\u3002<\/li>\n<\/ul>\n<p><strong>\u8be6\u7ec6\u89e3\u91ca\uff1a<\/strong><\/p>\n<ol>\n<li><strong>\u805a\u5149\u706f\u6548\u679c\uff1a<\/strong><\/li>\n<\/ol>\n<pre>@keyframes swing {\n    0% {\n        transform: rotate(0deg);\n    }\n    25% {\n        transform: rotate(5deg);\n    }\n    75% {\n        transform: rotate(-5deg);\n    }\n    100% {\n        transform: rotate(0deg);\n    }\n}\n\n.spotlight {\n    animation: swing 1s infinite alternate;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li><strong>\u7ffb\u9875\u6548\u679c\uff1a<\/strong><\/li>\n<\/ol>\n<pre>.container {\n    position: relative;\n    overflow: hidden;\n}\n\n.slides {\n    position: absolute;\n    left: 0;\n    width: 100%;\n}\n\n.slides img {\n    width: 100%;\n}\n\n.next-button, .prev-button {\n    position: absolute;\n    top: 50%;\n    transform: translateY(-50%);\n    cursor: pointer;\n}\n\n.next-button {\n    right: 0;\n}\n\n.prev-button {\n    left: 0;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7f51\u9875\u8bbe\u8ba1\u5927\u795e\uff0c\u5982\u4f55\u7528CSS\u5b9e\u73b0\u805a\u5149\u706f\u6447\u6446\u548c\u7ffb\u9875\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>\u8bf7\u6559\u7f51\u9875\u8bbe\u8ba1\u5927\u795e\uff1a\u7ffb\u9875\u548c\u805a\u5149\u706f\u6548\u679c\u7684\u5b9e\u73b0 \u4e00\u4f4d\u8bbe\u8ba1\u5e08\u8bf7\u6559\u5927\u795e\u6709\u5173\u7f51\u9875\u4e2d\u7ffb\u9875\u548c\u805a\u5149\u706f\u6548\u679c\u7684\u5b9e\u73b0\u3002\u63d0\u4f9b\u7684\u7f51\u9875\u5c55\u793a\u4e86\u8fd9\u4e24\u4e2a\u6548\u679c\u3002 \u95ee\u9898\uff1a \u8fd9\u4f4d\u8bbe\u8ba1\u5e08\u60f3\u8981\u4e86\u89e3\uff0c\u7f51\u9875\u4e2d\u5c55\u793a\u7684\u805a\u5149\u706f\u548c\u7ffb\u9875\u6548\u679c\u662f\u5982\u4f55\u4f7f\u7528 javascript \u5b9e\u73b0\u7684\u3002 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u7b54\u6848\uff1a \u8ba9\u4eba\u60ca\u8bb6\u7684\u662f\uff0c\u8fd9\u4e24\u79cd\u6548\u679c\u5e76\u4e0d\u9700\u8981 javascript \u5c31\u80fd\u5b9e\u73b0\u3002 \u805a\u5149\u706f\u6548\u679c\uff1a\u4f7f\u7528 3 \u4e2d\u7684\u52a8\u753b\u5c5e\u6027\u5b9e\u73b0\u4e86\u6447\u6446\u6548\u679c\u3002 \u7ffb\u9875\u6548\u679c\uff1a\u901a\u8fc7\u5b9a\u4f4d\u5b9e\u73b0\u4e86\uff0c\u5176\u539f\u7406\u4e0e\u8f6e\u64ad\u56fe\u7c7b\u4f3c\u3002 \u8be6\u7ec6\u89e3\u91ca\uff1a \u805a\u5149\u706f\u6548\u679c\uff1a @keyframes swing { 0% { transform: rotate(0deg); } 25% { transform: rotate(5deg); } 75% { transform: rotate(-5deg); } 100% { transform: rotate(0deg); } } .spotlight { animation: swing 1s infinite alternate; } \u767b\u5f55\u540e\u590d\u5236 \u7ffb\u9875\u6548\u679c\uff1a .container { position: relative; [&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-3396","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/3396","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=3396"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/3396\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=3396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=3396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=3396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}