{"id":3934,"date":"2024-11-10T14:55:05","date_gmt":"2024-11-10T06:55:05","guid":{"rendered":"https:\/\/fwq.ai\/blog\/3934\/"},"modified":"2024-11-10T14:55:05","modified_gmt":"2024-11-10T06:55:05","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88%e8%ae%be%e7%bd%aespan%e5%85%83%e7%b4%a0%e7%9a%84display%e5%b1%9e%e6%80%a7%e4%b8%bainline-block%e4%bc%9a%e5%bd%b1%e5%93%8d%e7%88%b6%e7%ba%a7%e5%85%83%e7%b4%a0%e7%9a%84","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/3934\/","title":{"rendered":"\u4e3a\u4ec0\u4e48\u8bbe\u7f6espan\u5143\u7d20\u7684display\u5c5e\u6027\u4e3ainline-block\u4f1a\u5f71\u54cd\u7236\u7ea7\u5143\u7d20\u7684\u9ad8\u5ea6\uff0c\u800c\u8bbe\u7f6e\u4e3ainline\u5219\u4e0d\u4f1a\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173119861997397.jpg\" class=\"aligncenter\" title=\"\u4e3a\u4ec0\u4e48\u8bbe\u7f6espan\u5143\u7d20\u7684display\u5c5e\u6027\u4e3ainline-block\u4f1a\u5f71\u54cd\u7236\u7ea7\u5143\u7d20\u7684\u9ad8\u5ea6\uff0c\u800c\u8bbe\u7f6e\u4e3ainline\u5219\u4e0d\u4f1a\uff1f\u63d2\u56fe\" alt=\"\u4e3a\u4ec0\u4e48\u8bbe\u7f6espan\u5143\u7d20\u7684display\u5c5e\u6027\u4e3ainline-block\u4f1a\u5f71\u54cd\u7236\u7ea7\u5143\u7d20\u7684\u9ad8\u5ea6\uff0c\u800c\u8bbe\u7f6e\u4e3ainline\u5219\u4e0d\u4f1a\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>Span\u7684Display\u5c5e\u6027\u5982\u4f55\u5f71\u54cd\u7236\u7ea7\u5143\u7d20\u9ad8\u5ea6\uff1f<\/strong><\/p>\n<p>\u5f53\u8bbe\u7f6espan\u5143\u7d20\u7684display\u5c5e\u6027\u4e3ainline-block\u65f6\uff0c\u5176\u7236\u7ea7\u5143\u7d20\u7684\u9ad8\u5ea6\u4e3a30px\uff0c\u800c\u5f53\u8bbe\u7f6edisplay\u5c5e\u6027\u4e3ainline\u65f6\uff0c\u7236\u7ea7\u5143\u7d20\u7684\u9ad8\u5ea6\u53d8\u4e3a0\u3002<\/p>\n<p><strong>\u539f\u56e0\uff1a<\/strong><\/p>\n<p>\u4e0d\u540cdisplay\u5c5e\u6027\u4f1a\u521b\u5efa\u4e0d\u540c\u7684\u683c\u5f0f\u5316\u4e0a\u4e0b\u6587\uff08Formatting Context\uff0cFC\uff09\uff1a<\/p>\n<ul>\n<li> <strong>inline-block<\/strong>\u521b\u5efa\u4e00\u4e2a<strong>\u5757\u683c\u5f0f\u5316\u4e0a\u4e0b\u6587\uff08BFC\uff09<\/strong>\uff0c\u5b83\u5b9a\u4e49\u4e86\u5143\u7d20\u72ec\u7acb\u7684\u5e03\u5c40\u548c\u5782\u76f4\u8fb9\u8ddd\u6298\u53e0\u3002\u56e0\u6b64\uff0cBFC\u5185\u5143\u7d20\u95f4\u4e0d\u4f1a\u76f8\u4e92\u91cd\u53e0\uff0c\u800c\u7236\u7ea7\u5143\u7d20\u9ad8\u5ea6\u53d7\u5b50\u5143\u7d20\u5185\u5bb9\u7684\u9ad8\u5ea6\u5f71\u54cd\uff0c\u537330px\u3002<\/li>\n<li> <strong>inline<\/strong>\u521b\u5efa\u4e00\u4e2a<strong>\u5185\u8054\u683c\u5f0f\u5316\u4e0a\u4e0b\u6587\uff08IFC\uff09<\/strong>\uff0c\u5b83\u963b\u6b62\u5143\u7d20\u521b\u5efaBFC\u3002\u56e0\u6b64\uff0c\u5143\u7d20\u4e0d\u4f1a\u5f71\u54cd\u7236\u7ea7\u5143\u7d20\u9ad8\u5ea6\uff0c\u5e76\u4e14\u7236\u7ea7\u5143\u7d20\u9ad8\u5ea6\u4e3a0\u3002<\/li>\n<\/ul>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728IFC\u4e2d\uff0c\u5143\u7d20\u4e0d\u4f1a\u521b\u5efa\u96f6\u5bbd\u5ea6\u652f\u67f1\u6216\u8bbe\u7f6e\u884c\u9ad8\u3002\u56e0\u6b64\uff0c\u5373\u4f7f\u8bbe\u7f6e\u4e86\u884c\u9ad8\uff0cspan\u5143\u7d20\u5728display\u4e3ainline\u65f6\u4e5f\u4e0d\u4f1a\u6709\u9ad8\u5ea6\u3002<\/p>\n<p><strong>\u5176\u4ed6\uff1a<\/strong><\/p>\n<p>\u5bf9\u4e8e\u8fdb\u4e00\u6b65\u7684\u7406\u89e3\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u8d44\u6e90\uff1a<\/p>\n<ul>\n<li>Why Empty Display Inline Block Element Create Height But Display Inline and Display Block not? &#8211; Stack Overflow<\/li>\n<li>html &#8211; How to determine height of content-box of a block and inline element &#8211; Stack Overflow<\/li>\n<li>[-display] Should &#8216;run-in flow-root&#8217; blockify to &#8216;block&#8217; or &#8216;flow-root&#8217;? \u00b7 Issue #1715 \u00b7 w3c\/csswg-drafts<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u8bbe\u7f6espan\u5143\u7d20\u7684display\u5c5e\u6027\u4e3ainline-block\u4f1a\u5f71\u54cd\u7236\u7ea7\u5143\u7d20\u7684\u9ad8\u5ea6\uff0c\u800c\u8bbe\u7f6e\u4e3ainline\u5219\u4e0d\u4f1a\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>Span\u7684Display\u5c5e\u6027\u5982\u4f55\u5f71\u54cd\u7236\u7ea7\u5143\u7d20\u9ad8\u5ea6\uff1f \u5f53\u8bbe\u7f6espan\u5143\u7d20\u7684display\u5c5e\u6027\u4e3ainline-block\u65f6\uff0c\u5176\u7236\u7ea7\u5143\u7d20\u7684\u9ad8\u5ea6\u4e3a30px\uff0c\u800c\u5f53\u8bbe\u7f6edisplay\u5c5e\u6027\u4e3ainline\u65f6\uff0c\u7236\u7ea7\u5143\u7d20\u7684\u9ad8\u5ea6\u53d8\u4e3a0\u3002 \u539f\u56e0\uff1a \u4e0d\u540cdisplay\u5c5e\u6027\u4f1a\u521b\u5efa\u4e0d\u540c\u7684\u683c\u5f0f\u5316\u4e0a\u4e0b\u6587\uff08Formatting Context\uff0cFC\uff09\uff1a inline-block\u521b\u5efa\u4e00\u4e2a\u5757\u683c\u5f0f\u5316\u4e0a\u4e0b\u6587\uff08BFC\uff09\uff0c\u5b83\u5b9a\u4e49\u4e86\u5143\u7d20\u72ec\u7acb\u7684\u5e03\u5c40\u548c\u5782\u76f4\u8fb9\u8ddd\u6298\u53e0\u3002\u56e0\u6b64\uff0cBFC\u5185\u5143\u7d20\u95f4\u4e0d\u4f1a\u76f8\u4e92\u91cd\u53e0\uff0c\u800c\u7236\u7ea7\u5143\u7d20\u9ad8\u5ea6\u53d7\u5b50\u5143\u7d20\u5185\u5bb9\u7684\u9ad8\u5ea6\u5f71\u54cd\uff0c\u537330px\u3002 inline\u521b\u5efa\u4e00\u4e2a\u5185\u8054\u683c\u5f0f\u5316\u4e0a\u4e0b\u6587\uff08IFC\uff09\uff0c\u5b83\u963b\u6b62\u5143\u7d20\u521b\u5efaBFC\u3002\u56e0\u6b64\uff0c\u5143\u7d20\u4e0d\u4f1a\u5f71\u54cd\u7236\u7ea7\u5143\u7d20\u9ad8\u5ea6\uff0c\u5e76\u4e14\u7236\u7ea7\u5143\u7d20\u9ad8\u5ea6\u4e3a0\u3002 \u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728IFC\u4e2d\uff0c\u5143\u7d20\u4e0d\u4f1a\u521b\u5efa\u96f6\u5bbd\u5ea6\u652f\u67f1\u6216\u8bbe\u7f6e\u884c\u9ad8\u3002\u56e0\u6b64\uff0c\u5373\u4f7f\u8bbe\u7f6e\u4e86\u884c\u9ad8\uff0cspan\u5143\u7d20\u5728display\u4e3ainline\u65f6\u4e5f\u4e0d\u4f1a\u6709\u9ad8\u5ea6\u3002 \u5176\u4ed6\uff1a \u5bf9\u4e8e\u8fdb\u4e00\u6b65\u7684\u7406\u89e3\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u8d44\u6e90\uff1a Why Empty Display Inline Block Element Create Height But Display Inline and Display Block not? &#8211; Stack Overflow html &#8211; How to determine height of content-box of a block and inline element &#8211; Stack Overflow [-display] Should &#8216;run-in flow-root&#8217; blockify to &#8216;block&#8217; or &#8216;flow-root&#8217;? \u00b7 [&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-3934","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/3934","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=3934"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/3934\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=3934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=3934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=3934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}