{"id":1514,"date":"2023-03-25T14:07:41","date_gmt":"2023-03-25T06:07:41","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1514"},"modified":"2023-04-28T20:20:35","modified_gmt":"2023-04-28T12:20:35","slug":"wechat-mini-program-centered-layout","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/25\/wechat-mini-program-centered-layout\/","title":{"rendered":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5c45\u4e2d\u5e03\u5c40"},"content":{"rendered":"<p>\u4f7f\u7528flex\u5f39\u6027\u5e03\u5c40\u53ef\u4ee5\u5feb\u901f\u5b9e\u73b0\u6240\u9700\u8981\u7684\u5e03\u5c40\uff08\u6c34\u5e73\u5c45\u4e2d\u3001\u5782\u76f4\u5c45\u4e2d\u3001\u5de6\u53f3\u5bf9\u9f50\u7b49\uff09 <\/p>\n<h4>\u4f7f\u7528\u7b80\u4ecb<\/h4>\n<p><!-- more --><\/p>\n<ul>\n<li>\u5e03\u5c40\uff1adisplay:flex<\/li>\n<li>\u5c5e\u6027\uff1ajustify-content\u548calign-items<\/li>\n<li>flex-direction(\u8f74\u7ebf\u65b9\u5411): row(\u6c34\u5e73\uff0c\u9ed8\u8ba4)\u3001column(\u5782\u76f4)<\/li>\n<li>justify-content: flex\u5b50\u9879\u7684\u4e3b\u8f74\u6392\u5217\u65b9\u5f0f\uff0c\u53d6\u503c\u5305\u62ec\uff1aflex-start | flex-end | center | space-between | space-around<\/li>\n<li>align-items: flex\u5b50\u9879\u7684\u4fa7\u8f74\u6392\u5217\u65b9\u5f0f\uff0c\u53d6\u503c\u5305\u62ec\uff1aflex-start | flex-end | center | stretch<\/li>\n<li>flex-wrap\uff1a\u5b50\u5143\u7d20\u6ea2\u51fa\u5904\u7406\uff0c\u53d6\u503c\u5305\u62ec\uff1anowrap(\u4e0d\u6362\u884c) | wrap(\u987a\u5e8f\u6362\u884c) | wrap-reverse(\u9006\u5e8f\u6362\u884c)<\/li>\n<\/ul>\n<blockquote>\n<p>\u8f74\u7ebf\u4e3e\u4f8b\uff1a\u7236\u7ea7\u5143\u7d20\u4f7f\u7528flex\u5e03\u5c40\uff0c\u9ed8\u8ba4\u5e03\u5c40\u4e0b\u5757\u7ea7\u5143\u7d20\u662f\u4f1a\u6362\u884c\u7684\uff0c\u4f46\u8bbe\u7f6eflex\u5e03\u5c40\u540e\u5373\u53ef\u6c34\u5e73\u6392\u5217\u3002\u6ce8\uff1a\u5f53\u6a2a\u5411\u6392\u5217\u65f6 \u4e3b\u8f74\u5c31\u662fx\u8f74\uff1b\u53cd\u4e4b\u5219\u662fy\u8f74\u3002<\/p>\n<\/blockquote>\n<h4>\u6c34\u5e73\u5c45\u4e2d<\/h4>\n<pre><code class=\"language-css\">.gravity-horizontal-center{\n  display:flex;\n  justify-content:center;\n}<\/code><\/pre>\n<h4>\u5782\u76f4\u5c45\u4e2d<\/h4>\n<pre><code class=\"language-css\">.gravity-vertical-center{\n  display:flex;\n  align-items:center;\n}<\/code><\/pre>\n<h4>\u6c34\u5e73\u5782\u76f4\u5168\u90e8\u5c45\u4e2d<\/h4>\n<pre><code class=\"language-css\">.gravity-center{\n  display:flex;\n  justify-content:center;\n  align-items:center;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528flex\u5f39\u6027\u5e03\u5c40\u53ef\u4ee5\u5feb\u901f\u5b9e\u73b0\u6240\u9700\u8981\u7684\u5e03\u5c40\uff08\u6c34\u5e73\u5c45\u4e2d\u3001\u5782\u76f4\u5c45\u4e2d\u3001\u5de6\u53f3\u5bf9\u9f50\u7b49\uff09 \u4f7f\u7528\u7b80\u4ecb \u5e03\u5c40\uff1adisplay [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[],"class_list":["post-1514","post","type-post","status-publish","format-standard","hentry","category-wechat-mini-program"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1514","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1514"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1514\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}