{"id":27791,"date":"2024-11-24T15:04:03","date_gmt":"2024-11-24T07:04:03","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27791\/"},"modified":"2024-11-24T15:04:03","modified_gmt":"2024-11-24T07:04:03","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8%e7%ba%af-css-%e5%ae%9e%e7%8e%b0%e5%9b%b4%e7%bb%95%e5%9c%86%e5%bf%83%e5%88%86%e7%b1%bb%e6%91%86%e6%94%be%e5%85%83%e7%b4%a0%e7%9a%84%e5%b8%83%e5%b1%80%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27791\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528\u7eaf CSS \u5b9e\u73b0\u56f4\u7ed5\u5706\u5fc3\u5206\u7c7b\u6446\u653e\u5143\u7d20\u7684\u5e03\u5c40\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173131670793268.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528\u7eaf CSS \u5b9e\u73b0\u56f4\u7ed5\u5706\u5fc3\u5206\u7c7b\u6446\u653e\u5143\u7d20\u7684\u5e03\u5c40\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528\u7eaf CSS \u5b9e\u73b0\u56f4\u7ed5\u5706\u5fc3\u5206\u7c7b\u6446\u653e\u5143\u7d20\u7684\u5e03\u5c40\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u56f4\u7ed5\u5706\u5fc3\u8fdb\u884c  \u5e03\u5c40<\/strong><\/p>\n<p>\u5728\u9879\u76ee\u5f00\u53d1\u4e2d\uff0c\u6709\u65f6\u4f1a\u9047\u5230\u9700\u8981\u56f4\u7ed5\u5706\u5fc3\u5206\u7c7b\u6446\u653e\u5143\u7d20\u7684\u60c5\u51b5\u3002\u5982\u4f55\u4f7f\u7528\u7eaf css \u5b9e\u73b0\u8fd9\u6837\u7684\u5e03\u5c40\uff0c\u800c\u4e0d\u501f\u52a9\u65cb\u8f6c\u4e14\u52a8\u6001\u83b7\u53d6\u540e\u7aef\u4f20\u6765\u7684\u6807\u7b7e\u5462\uff1f<\/p>\n<p><strong>css \u5b9e\u73b0\u601d\u8def<\/strong><\/p>\n<p>\u8981\u5b9e\u73b0\u56f4\u7ed5\u5706\u5fc3\u5e03\u5c40\uff0c\u53ef\u4ee5\u501f\u52a9 css \u4e2d\u7684 transform \u5c5e\u6027\uff0c\u901a\u8fc7\u65cb\u8f6c\u3001\u4f4d\u79fb\u548c\u53cd\u5411\u65cb\u8f6c\u7b49\u64cd\u4f5c\u6765\u5b9e\u73b0\uff1a<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<pre>left: 50%;\ntop: 50%;\ntransform: translate(-50%, -50%) rotate(angle) translate(r) rotate(-angle);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff1a<\/p>\n<ul>\n<li>angle \u4e3a\u5143\u7d20\u76f8\u5bf9\u4e8e\u5706\u5fc3\u7684\u65cb\u8f6c\u89d2\u5ea6<\/li>\n<li>r \u4e3a\u5143\u7d20\u5230\u5706\u5fc3\u7684\u8ddd\u79bb<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u8c03\u6574 angle \u548c r \u7684\u503c\uff0c\u53ef\u4ee5\u52a8\u6001\u8c03\u6574\u5143\u7d20\u5728\u5706\u5468\u4e0a\u7684\u4f4d\u7f6e\u3002<\/p>\n<p><strong>\u6f14\u793a\u6548\u679c<\/strong><\/p>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u8be5\u65b9\u6cd5\u5b9e\u73b0\u7684\u793a\u4f8b\uff1a<\/p>\n<pre>&lt;div class=\"item\"&gt;&lt;\/div&gt;\n&lt;div class=\"item\"&gt;&lt;\/div&gt;\n&lt;div class=\"item\"&gt;&lt;\/div&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<pre>.item {\n  position: absolute;\n  width: 100px;\n  height: 100px;\n  background: #f00;\n  left: 50%;\n  top: 50%;\n  transform: translate(-50%, -50%) rotate(45deg) translate(150px) rotate(-45deg);\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6700\u7ec8\u6548\u679c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p>[\u56fe\u7247\uff1a\u5706\u5f62\u5e03\u5c40\u793a\u4f8b]<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528\u7eaf CSS \u5b9e\u73b0\u56f4\u7ed5\u5706\u5fc3\u5206\u7c7b\u6446\u653e\u5143\u7d20\u7684\u5e03\u5c40\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>\u56f4\u7ed5\u5706\u5fc3\u8fdb\u884c \u5e03\u5c40 \u5728\u9879\u76ee\u5f00\u53d1\u4e2d\uff0c\u6709\u65f6\u4f1a\u9047\u5230\u9700\u8981\u56f4\u7ed5\u5706\u5fc3\u5206\u7c7b\u6446\u653e\u5143\u7d20\u7684\u60c5\u51b5\u3002\u5982\u4f55\u4f7f\u7528\u7eaf css \u5b9e\u73b0\u8fd9\u6837\u7684\u5e03\u5c40\uff0c\u800c\u4e0d\u501f\u52a9\u65cb\u8f6c\u4e14\u52a8\u6001\u83b7\u53d6\u540e\u7aef\u4f20\u6765\u7684\u6807\u7b7e\u5462\uff1f css \u5b9e\u73b0\u601d\u8def \u8981\u5b9e\u73b0\u56f4\u7ed5\u5706\u5fc3\u5e03\u5c40\uff0c\u53ef\u4ee5\u501f\u52a9 css \u4e2d\u7684 transform \u5c5e\u6027\uff0c\u901a\u8fc7\u65cb\u8f6c\u3001\u4f4d\u79fb\u548c\u53cd\u5411\u65cb\u8f6c\u7b49\u64cd\u4f5c\u6765\u5b9e\u73b0\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(angle) translate(r) rotate(-angle); \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff1a angle \u4e3a\u5143\u7d20\u76f8\u5bf9\u4e8e\u5706\u5fc3\u7684\u65cb\u8f6c\u89d2\u5ea6 r \u4e3a\u5143\u7d20\u5230\u5706\u5fc3\u7684\u8ddd\u79bb \u901a\u8fc7\u8c03\u6574 angle \u548c r \u7684\u503c\uff0c\u53ef\u4ee5\u52a8\u6001\u8c03\u6574\u5143\u7d20\u5728\u5706\u5468\u4e0a\u7684\u4f4d\u7f6e\u3002 \u6f14\u793a\u6548\u679c \u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u8be5\u65b9\u6cd5\u5b9e\u73b0\u7684\u793a\u4f8b\uff1a &lt;div class=&#8221;item&#8221;&gt;&lt;\/div&gt; &lt;div class=&#8221;item&#8221;&gt;&lt;\/div&gt; &lt;div class=&#8221;item&#8221;&gt;&lt;\/div&gt; \u767b\u5f55\u540e\u590d\u5236 .item { position: absolute; width: 100px; height: 100px; background: #f00; left: 50%; [&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-27791","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27791","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=27791"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27791\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}