{"id":4925,"date":"2015-08-30T00:47:36","date_gmt":"2015-08-29T16:47:36","guid":{"rendered":"http:\/\/www.zhangxinxu.com\/wordpress\/?p=4925"},"modified":"2019-10-18T18:20:59","modified_gmt":"2019-10-18T10:20:59","slug":"css-deep-understand-vertical-align-and-line-height","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2015\/08\/css-deep-understand-vertical-align-and-line-height\/","title":{"rendered":"CSS\u6df1\u5165\u7406\u89e3vertical-align\u548cline-height\u7684\u57fa\u53cb\u5173\u7cfb"},"content":{"rendered":"<p>by <a href=\"https:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"https:\/\/www.zhangxinxu.com\/\">https:\/\/www.zhangxinxu.com<\/a><br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=4925\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=4925<\/a><\/p>\n<h3>\u4e00\u3001\u60f3\u6b7b\u4f60\u4eec\u4e86<\/h3>\n<p>\u51e0\u4e2a\u661f\u671f\u6ca1\u6709\u5199\u6587\u7ae0\u4e86\uff0c\u597d\u5fd9\u597d\u75d2\uff1b\u4e2a\u628a\u6708\u6ca1\u6709\u5199\u957f\u7bc7\u4e86\uff0c\u597d\u5fd9\u597d\u60f3\uff1b\u534a\u4e2a\u5b63\u5ea6\u6ca1\u5728\u6587\u7ae0\u4e2d\u5520\u55d1\u4e86\uff0c\u597d\u75d2\u597d\u60f3\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201508\/fengong.jpg\" width=\"300\" height=\"199\" class=\"alignnone\" \/><\/p>\n<p>\u540e\u9762\u4e00\u680b\u697c\u6709\u5bf9\u592b\u59bb\u5728\u5435\u67b6\uff0c\u58f0\u97f3\u96c4\u6d51\u6709\u529b\uff0c\u4ea4\u950b\u9163\u7545\u6dcb\u6f13\uff0c\u8fd8\u4ee5\u4e3a\u53ea\u6709\u5c0f\u4e61\u9547\u624d\u6709\u8fd9\u67b6\u52bf\uff0c\u54e6\uff0c\u7a81\u7136\u60f3\u8d77\u6765\uff0c\u6211\u5c31\u662f\u4f4f\u5728\u4e0a\u6d77\u90ca\u5916\u7684\u5c0f\u4e61\u9547\u4e0a\u3002<\/p>\n<p>\u521a\u521a\u4e70\u4e86\u51e0\u5341\u80a1\u4eac\u4e1c\u7684\u80a1\u7968\uff0c\u7b2c\u4e00\u6b21\u73a9\u8fd9\u4e2a\uff0c\u770b\u597d\u4eac\u4e1c\u7684\u53d1\u5c55\u3002\u5176\u5b9e\u80a1\u4ef721\u7684\u65f6\u5019\u5c31\u6253\u7b97\u5165\u624b\u4e86\uff0c\u4f46\u662f\uff0c\u8f6c\u5916\u6c47\u7684\u65f6\u5019\uff0c\u63d0\u793a\uff0c\u8981\u5de5\u4f5c\u65f6\u95f4\u3002\u7136\u540e\u4e00\u5fd9\u4e8c\u5fd8\uff0c\u7b49\u73b0\u5728\u5165\u7684\u65f6\u5019\uff0c\u5df2\u7ecf\u6da8\u4e8620%\u591a\u4e86\uff0c\u79d1\u79d1\uff0c\u80a5\u7682\u5f04\u4eba\u554a\uff01\u5199\u5230\u8fd9\u91cc\u7684\u65f6\u5019\uff0c\u5fcd\u4e0d\u4f4f\u62ff\u51fa\u624b\u673a\u4e00\u770b\uff0c\u54ce\u5466\uff0c\u4e0d\u9519\u54e6\uff0c\u76c8\u522928\u5200\uff0c\u5b69\u5b50\u7684\u534a\u7f50\u5976\u7c89\u94b1\u6709\u4e86\uff0c\u54c8\u54c8\uff01<img decoding=\"async\" src=\"https:\/\/mat1.gtimg.com\/www\/mb\/images\/face\/28.gif\" align=\"absmiddle\" height=\"24\"><\/p>\n<p>\u8bf4\u8d77\u80a5\u7682\uff0c\u8ba9\u6211\u60f3\u8d77\u4e86\u300a\u76d1\u72f1\u5b66\u9662\u300b\uff0c\u79d1\u79d1~<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/imgservices-1252317822.image.myqcloud.com\/image\/20191018\/i4ye1ryvx4.gif\" width=\"250\" height=\"157\" alt=\"\u80a5\u7682\u57fa\u53cb\" class=\"alignnone\" onerror=\"this.src='\/\/image.zhangxinxu.com\/image\/blog\/201910\/feizao.jpg';\" \/><\/p>\n<p>\u539f\u6765\uff0c\u80a5\u7682\u548c\u57fa\u53cb\u7684\u4f20\u8bf4\u5df2\u7ecf\u4f20\u64ad\u5230\u4e8611\u533a\u3002\u5c82\u6b62\u554a\uff0c\u9664\u4e862\u6b21\u5143\uff0c\u4ee3\u7801\u6b21\u5143\u4e5f\u6df1\u53d7\u5176\u7231\uff0c\u6bd4\u65b9\u8bf4CSS\u5c4a\u7684<code>vertical-align<\/code>\u548c<code>line-height<\/code>\u5c31\u662f\u5178\u578b\u7684\u8868\u9762\u4e0a\u770b\u4e0a\u53bb\u5927\u76f8\u5f84\u5ead\uff0c\u5b9e\u9645\u4e0a\u662f\u5927\u8fdb\u540e\u5ead\u7684\u65ad\u80cc\u597d\u57fa\u53cb\u554a\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201508\/gouxue.jpg\" width=\"320\" height=\"209\" class=\"alignnone\" \/><\/p>\n<p>\u6ca1\u9519\uff0c\u5c31\u662f\u8fd9\u4e48\u72d7\u8840\uff01<\/p>\n<p>\u4e61\u4e0b\u4eba\u4e0d\u6253\u8bf3\u8bed\uff0c\u4e0b\u9762\u6211\u5c31\u597d\u597d\u8ddf\u5927\u5bb6\u516b\u5366\u4e0b\uff0c<code>vertical-align<\/code>\u548c<code>line-height<\/code>\u4e4b\u95f4\u4ee4\u4eba\u53d1\u6307\u7684\u57fa\u53cb\u5173\u7cfb\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201508\/enen.gif\" width=\"100\" height=\"100\" alt=\"\u6069\u6069\" class=\"alignnone\" \/><\/p>\n<h3>\u4e8c\u3001\u8868\u73b0\u660e\u663e\u7684\u65ad\u80cc\u57fa\u60c5<\/h3>\n<p>\u4f17\u6240\u5468\u77e5\uff0c<code>vertical-align<\/code>\u652f\u6301\u5f88\u591a\u5c5e\u6027\u503c\uff0c\u8db3\u8db3\u53ef\u4ee5\u7ec4\u6210\u4e00\u4e2a\u8db3\u7403\u961f\u4e86\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre><span style=\"color:green;\">\/* \u5173\u952e\u5b57\u503c *\/<\/span>\r\n<span class=\"token property\">vertical-align<\/span><span class=\"token punctuation\">:<\/span> baseline<span class=\"token punctuation\">;<\/span>\r\n<span class=\"token property\">vertical-align<\/span><span class=\"token punctuation\">:<\/span> sub<span class=\"token punctuation\">;<\/span>\r\n<span class=\"token property\">vertical-align<\/span><span class=\"token punctuation\">:<\/span> super<span class=\"token punctuation\">;<\/span>\r\n<span class=\"token property\">vertical-align<\/span><span class=\"token punctuation\">:<\/span> text-top<span class=\"token punctuation\">;<\/span>\r\n<span class=\"token property\">vertical-align<\/span><span class=\"token punctuation\">:<\/span> text-bottom<span class=\"token punctuation\">;<\/span>\r\n<span class=\"token property\">vertical-align<\/span><span class=\"token punctuation\">:<\/span> middle<span class=\"token punctuation\">;<\/span>\r\n<span class=\"token property\">vertical-align<\/span><span class=\"token punctuation\">:<\/span> top<span class=\"token punctuation\">;<\/span>\r\n<span class=\"token property\">vertical-align<\/span><span class=\"token punctuation\">:<\/span> bottom<span class=\"token punctuation\">;<\/span>\r\n\r\n<span style=\"color:green;\">\/* &lt;\u957f\u5ea6&gt; \u503c *\/<\/span>\r\n<span class=\"token property\">vertical-align<\/span><span class=\"token punctuation\">:<\/span> 10em<span class=\"token punctuation\">;<\/span>\r\n<span class=\"token property\">vertical-align<\/span><span class=\"token punctuation\">:<\/span> 4px<span class=\"token punctuation\">;<\/span>\r\n\r\n<span style=\"color:green;\">\/* &lt;\u767e\u5206\u6bd4&gt; \u503c *\/<\/span>\r\n<span style=\"color:#cd0000;\">vertical-align: 10%;<\/span>\r\n\r\n<span style=\"color:green;\">\/* \u5168\u5c40\u503c *\/<\/span>\r\n<span class=\"token property\">vertical-align<\/span><span class=\"token punctuation\">:<\/span> inherit<span class=\"token punctuation\">;<\/span>\r\n<span class=\"token property\">vertical-align<\/span><span class=\"token punctuation\">:<\/span> initial<span class=\"token punctuation\">;<\/span>\r\n<span class=\"token property\">vertical-align<\/span><span class=\"token punctuation\">:<\/span> unset<span class=\"token punctuation\">;<\/span><\/pre>\n<\/div>\n<p>\u5176\u4e2d\uff0c\u6709\u4e2a\u5c5e\u6027\u503c\u66b4\u9732\u4e86<code>vertical-align<\/code>\u548c<code>line-height<\/code>\u4e4b\u95f4\u7684\u57fa\u53cb\u5173\u7cfb\uff0c\u5927\u5bb6\u731c\u731c\u770b\u662f\u54ea\u4e2a\u5c5e\u6027\u503c\uff1f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201508\/whats-s.png\" width=\"240\" height=\"156\" alt=\"\u60f3\u4e0d\u660e\u767d\" class=\"alignnone\" \/><\/p>\n<p>\u54c7\u585e\uff0c\u597d\u5389\u5bb3\uff01\u5c45\u7136\u88ab\u5927\u5bb6\u4e00\u773c\u5c31\u770b\u51fa\u6765\u4e86\uff0c\u6ca1\u9519\uff0c\u5c31\u662f\u201c\u767e\u5206\u6bd4\u503c\u201d\u3002<\/p>\n<p><code>vertical-align<\/code>\u7684\u767e\u5206\u6bd4\u503c\u4e0d\u662f\u76f8\u5bf9\u4e8e\u5b57\u4f53\u5927\u5c0f\u6216\u8005\u5176\u4ed6\u4ec0\u4e48\u5c5e\u6027\u8ba1\u7b97\u7684\uff0c\u800c\u662f\u76f8\u5bf9\u4e8e<code>line-height<\/code>\u8ba1\u7b97\u7684\u3002\u4e3e\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u5982\u4e0bCSS\u4ee3\u7801\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>{\r\n  line-height: 30px;\r\n  vertical-align: -10%;\r\n}<\/pre>\n<\/div>\n<p>\u5b9e\u9645\u4e0a\uff0c\u7b49\u540c\u4e8e\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>{\r\n  line-height: 30px;\r\n  vertical-align: <span style=\"color:#cd0000;\">-3px;<\/span>    <span style=\"color:green;\">\/* = 30px <span class=\"fs\">*<\/span> -10% *\/<\/span>  \r\n}<\/pre>\n<\/div>\n<p>CSS\u5c5e\u6027\u4f55\u5176\u591a\uff0c\u504f\u504f\u8ddf<code>line-height<\/code>\u6709\u4e00\u817f\uff0c\u8fd9\u4e0d\u662f\u6709\u57fa\u60c5\u90a3\u662f\u4ec0\u4e48\uff1f<\/p>\n<p><span class=\"s\">\/\/zxx: IE6\/IE7\u6d4f\u89c8\u5668\u4e0b\u7684vertical-align\u7684\u767e\u5206\u6bd4\u503c\u4e0d\u652f\u6301\u5c0f\u6570line-height<\/span><\/p>\n<h3>\u4e09\u3001\u80cc\u5730\u91cc\u65e0\u5904\u4e0d\u5728\u7684\u57fa\u53cb\u5173\u7cfb<\/h3>\n<blockquote><p>\/\/zxx: <strong>\u6ce8\u610f<\/strong>\uff0c<code>vertical-align<\/code>\u548c<code>line-height<\/code>\u7684\u5730\u4e0b\u57fa\u53cb\u5173\u7cfb\u4eceHTML5\u6587\u6863\u58f0\u660e\u5f00\u59cb\u7684\uff0c\u56e0\u6b64\uff0c\u4ee5\u4e0b\u63a2\u8ba8\u7684\u73b0\u8c61\uff0c\u90fd\u662f\u5728\u9875\u9762\u4e3aHTML5\u58f0\u660e\u524d\u63d0\u4e0b\uff0c\u7c7b\u4f3c\u4e0b\u9762\u7684doctype:<\/p>\n<div class=\"zxx_code\">\n<pre>&lt;!doctype html>\r\n&lt;html><\/pre>\n<\/div>\n<p>\u53e6\u5916\uff0c\u4e0b\u9762\u5f88\u591a\u6548\u679c\u76f4\u63a5\u5c31\u662f\u771f\u5b9e\u6f14\u793a\uff0c\u56e0\u6b64\uff0c\u8bf7\u4f7f\u7528\u73b0\u4ee3\u6d4f\u89c8\u5668\u89c2\u6469\u4e0b\u9762\u7684\u5185\u5bb9\u3002\u5982\u679c\u53d1\u73b0\u67d0\u4e9b\u884c\u4e3a\u4e0e\u63cf\u8ff0\u4e0d\u5339\u914d\uff0c\u4e14\u6d4f\u89c8\u5668\u6b63\u5e38\uff0c\u90a3\u53ef\u80fd\u662f\u56e0\u4e3a\u4f60\u8bbf\u95ee\u7684\u5e76\u4e0d\u662f<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=4925\">\u539f\u51fa\u5904<\/a>\u3002<\/p><\/blockquote>\n<p><strong style=\"display:block;padding-top:10px;\"><big>\u2460 \u57fa\u672c\u73b0\u8c61<\/big><\/strong><\/p>\n<p>\u8981\u516b\u5366<code>vertical-align<\/code>\u548c<code>line-height<\/code>\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u6211\u4eec\u4e0d\u59a8\u4ece\u4e00\u4e2a\u6781\u5176\u7b80\u5355\u7684\u73b0\u8c61\u5165\u624b\u3002\u5047\u8bbe\uff0c\u6211\u4eec\u6709\u4e00\u4e2a<code>&lt;div&gt;<\/code>\u6807\u7b7e\uff0c\u7136\u540e\uff0c\u91cc\u9762\u6709\u4e00\u5f20<code>&lt;img&gt;<\/code>\u56fe\u7247\uff0c\u6211\u4eec\u7684HTML\u4ee3\u7801\u5c31\u662f\u8fd9\u6837\u5b50\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>&lt;div>&lt;img src=\"mm1.jpg\">&lt;\/div><\/pre>\n<\/div>\n<p>\u7136\u540e\uff0c\u8868\u73b0\u5c31\u662f\u4e00\u5f20\u56fe\u7247\u5448\u73b0\uff0c\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u6837\uff1a<\/p>\n<div><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s256\/mm1.jpg\" height=\"191\"><\/div>\n<p>\u6069\uff0c\u770b\u4e0a\u53bb\u5f88\u6b63\u5e38\uff0c\u4e00\u5207\u90fd\u662f\u7406\u6240\u5f53\u7136\u3002\u7136\u800c\uff0c\u5982\u679c\u6211\u4eec\u7ed9\u8fd9\u4e2a<code>&lt;div&gt;<\/code>\u5143\u7d20\u589e\u52a0\u4e00\u4e2a\u80cc\u666f\u8272\uff0c\u4f8b\u5982\u6de1\u84dd\u8272\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>&lt;div style=\"background-color:#e5edff;\">&lt;img src=\"mm1.jpg\">&lt;\/div><\/pre>\n<\/div>\n<p>\u5219\u4f1a\u662f\u4e0b\u9762\u8fd9\u6837\uff1a<\/p>\n<div style=\"background-color:#E5EDFF;\"><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s256\/mm1.jpg\" height=\"191\"><\/div>\n<p>\u4f1a\u53d1\u73b0\u56fe\u7247\u4e0b\u9762\u6709\u4e00\u6bb5\u7a7a\u767d\u7a7a\u95f4\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201508\/2015-08-29_085105.png\" width=\"341\" height=\"81\" alt=\"\u56fe\u7247\u4e0e\u7a7a\u767d\" class=\"alignnone\" \/><\/p>\n<p>\u60f3\u5fc5\u5927\u5bb6\u90fd\u9047\u5230\u8fc7\u7c7b\u4f3c\u95ee\u9898\uff0c\u4e0d\u77e5\u5927\u5bb6\u6709\u6ca1\u6709\u601d\u8003\u8fc7\uff0c\u4e3a\u4ec0\u4e48\u56fe\u7247\u4e0b\u9762\u6709\u7559\u6709\u4e00\u6bb5\u95f4\u9699\u5462\uff1f<img decoding=\"async\" src=\"https:\/\/mat1.gtimg.com\/www\/mb\/images\/face\/32.gif\" align=\"absmiddle\" height=\"24\"><\/p>\n<p>\u5b9e\u9645\u4e0a\uff0c\u8fd9\u6bb5\u7a7a\u767d\u95f4\u9699\u5c31\u662f<code>vertical-align<\/code>\u548c<code>line-height<\/code>\u643a\u624b\u641e\u7684\u9b3c\uff01<\/p>\n<p>\u9996\u5148\uff0c\u5927\u5bb6\u4e00\u5b9a\u8981\u610f\u8bc6\u5230\u8fd9\u4e48\u4e00\u70b9\uff1a<strong>\u5bf9\u4e8e\u5185\u8054\u5143\u7d20\uff0cvertical-align\u4e0eline-height\u867d\u7136\u770b\u4e0d\u89c1\uff0c\u4f46\u5b9e\u9645\u4e0a\u300c\u5230\u5904\u90fd\u662f\u300d\uff01<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201508\/anywhere.jpg\" width=\"320\" height=\"175\" alt=\"\u5230\u5904\u90fd\u662f\" class=\"alignnone\" \/><\/p>\n<p>\u56e0\u6b64\uff0c\u5bf9\u4e8e\u5185\u8054\u5143\u7d20\u5404\u79cd\u60f3\u5f97\u901a\u6216\u8005\u60f3\u4e0d\u901a\u7684\u884c\u4e3a\u8868\u73b0\uff0c\u57fa\u672c\u4e0a\u90fd\u53ef\u4ee5\u7528<code>vertical-align<\/code>\u548c<code>line-height<\/code>\u6765\u89e3\u91ca\uff0c\u4ee5\u53ca\u8fdb\u884c\u884c\u4e3a\u77eb\u6b63\uff0c\u7136\u800c\uff0c\u8981\u6df1\u5165\u7406\u89e3\u8fd9\u4e9b\u884c\u4e3a\u8868\u73b0\uff0c\u8fd8\u662f\u9700\u8981\u72e0\u82b1\u4e00\u756a\u529f\u592b\u7684\uff0c\u56e0\u6b64\uff0c\u4e0b\u9762\u7684\u5185\u5bb9\uff0c\u8bf7\u786e\u4fdd\u4f60\u6709\u534a\u5c0f\u65f6\u5145\u8db3\u65f6\u95f4\u7ec6\u7ec6\u9605\u8bfb\uff0c\u522b\u7684\u5730\u65b9\u53ef\u662f\u770b\u4e0d\u5230\u7684\u3002<img decoding=\"async\" src=\"https:\/\/mat1.gtimg.com\/www\/mb\/images\/face\/14.gif\" align=\"absmiddle\" height=\"24\"><\/p>\n<p><strong style=\"display:block;padding-top:10px;\"><big>\u2461 \u5e7d\u7075\u7a7a\u767d\u8282\u70b9<\/big><\/strong><\/p>\n<p><strong>\u300c\u5e7d\u7075\u7a7a\u767d\u8282\u70b9\u300d<\/strong>\u8fd9\u4e2a\u6982\u5ff5\u6211\u81ea\u5df1\u547d\u540d\u7684\uff0c\u6ce8\u610f\uff0c\u662f\u6211\u4e2a\u4ebaYY\u51fa\u6765\u7684\uff0c\u662f\u6211\u81ea\u5df1\u4fbf\u4e8e\u7406\u89e3\u67d0\u4e9b\u884c\u4e3a\u7279\u5f81\u63d0\u51fa\u7684\u6982\u5ff5\u3002\u89c4\u8303\u53ef\u80fd\u6709\u7c7b\u4f3c\u7684\u6982\u5ff5\uff0c\u4f46\u540d\u79f0\u5e76\u975e\u8fd9\u4e2a\u3002 W3C\u89c4\u8303\u867d\u7136\u6709\u5f88\u591a\u884c\u4e3a\u7684\u89e3\u91ca\u548c\u8bf4\u660e\uff0c\u4f46\u662f\uff0c\u6bd5\u7adf\u5b98\u65b9\u7684\u4e1c\u897f\uff0c\u8981\u6c42\u4e25\u8c28\u6b63\u5f0f\uff0c\u4f46\u662f\uff0c\u4e5f\u4f1a\u6709\u592a\u5e72\u592a\u6da9\u7684\u611f\u89c9\u3002\u5982\u679c\u5feb\u901f\u638c\u63e1\u548c\u7406\u89e3\u8fd9\u4e9b\u884c\u4e3a\u8868\u73b0\u5462\uff1f\u5c31\u6211\u4e2a\u4eba\u800c\u8a00\uff0c\u4ece\u4e24\u65b9\u9762\u5165\u624b\uff1a<strong>1.\u60c5\u611f\u5316\u8ba4\u77e5<\/strong>\uff1b<strong>2. \u5177\u8c61\u5316\u601d\u7ef4<\/strong>\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u6211\u79f0<code>vertical-align<\/code>\u548c<code>line-height<\/code>\u4e3a\u597d\u57fa\u53cb\uff08\u5305\u62ec\u4ee5\u524d\u79f0\u6d6e\u52a8\u548c\u7edd\u5bf9\u5b9a\u4f4d\u662f\u5144\u5f1f\uff09\uff0c\u5c31\u662f\u201c\u60c5\u611f\u5316\u8ba4\u77e5\u201d\uff1b\u800c\u8fd9\u91cc\u7684\u300c\u5e7d\u7075\u7a7a\u767d\u8282\u70b9\u300d\u5c31\u662f\u201c\u5177\u8c61\u5316\u601d\u7ef4\u201d\u3002<\/p>\n<p>\u90a3\u300c\u5e7d\u7075\u7a7a\u767d\u8282\u70b9\u300d\u662f\u4e2a\u4ec0\u4e48\u610f\u601d\u5462\uff1f<\/p>\n<p><strong>\u5728HTML5\u6587\u6863\u58f0\u660e\u4e0b\uff0c\u5757\u72b6\u5143\u7d20\u5185\u90e8\u7684\u5185\u8054\u5143\u7d20\u7684\u884c\u4e3a\u8868\u73b0\uff0c\u5c31\u597d\u50cf\u5757\u72b6\u5143\u7d20\u5185\u90e8\u8fd8\u6709\u4e00\u4e2a\uff08\u66f4\u6709\u53ef\u80fd\u4e24\u4e2a-\u524d\u540e\uff09\u770b\u4e0d\u89c1\u6478\u4e0d\u7740\u6ca1\u6709\u5bbd\u5ea6\u6ca1\u6709\u5b9e\u4f53\u7684\u7a7a\u767d\u8282\u70b9\uff0c\u8fd9\u4e2a\u5047\u60f3\u53c8\u4f3c\u4e4e\u5b58\u5728\u7684\u7a7a\u767d\u8282\u70b9\uff0c\u6211\u79f0\u4e4b\u4e3a\u201c\u5e7d\u7075\u7a7a\u767d\u8282\u70b9\u201d\u3002<\/strong> <span class=\"s\">\/\/zxx: \u81ea\u5df1\u6363\u817e\u7684\u6982\u5ff5\uff0c\u4e0d\u662f\u6743\u5a01\uff0c\u6b22\u8fce\u5176\u4ed6\u5c0f\u4f19\u4f34\u53cd\u9988\u6743\u5a01\u89e3\u91ca<\/span><\/p>\n<p>\u62bd\u8c61\u4e86\u8fd9\u4e2a\u6982\u5ff5\uff0c\u7edd\u5bf9\u5b9a\u4f4d\u4e0e<code>text-align<\/code>\u7684\u4e00\u4e9b\u884c\u4e3a\u8868\u73b0\uff0c\u4ee5\u53ca\u8fd9\u91cc\u7684\u884c\u4e3a\u8868\u73b0\uff0c\u5c31\u597d\u7406\u89e3\u4e86\u3002<\/p>\n<p>\u8fd8\u662f\u4e0a\u9762\u7684\u56fe\u7247\u4e0b\u8fb9\u7f18\u7559\u7a7a\u9699\u7684\u4f8b\u5b50\uff0c\u5b9e\u9645\u4e0a\uff0c\u8fd9\u79cd\u884c\u4e3a\u8868\u73b0\uff0c\u5c31\u8ddf\u56fe\u7247\u524d\u9762\u6216\u8005\u540e\u9762\u6709\u4e00\u4e2a\u5bbd\u5ea6\u4e3a0\u7684\u7a7a\u683c\u5143\u7d20\u8868\u73b0\u662f\u4e00\u81f4\u7684\u3002\u4f46\u662f\uff0c\u7a7a\u683c\u662f\u900f\u660e\u7684\uff0c\u4e3a\u4e86\u4fbf\u4e8e\u5927\u5bb6\u7406\u89e3\uff0c\u6211\u5c31\u76f4\u63a5\u4f7f\u7528\u5f88\u660e\u663e\u7684\u533f\u540dinline box, \u4e5f\u5c31\u662f\u5b57\u7b26\u4ee3\u66ff\u3002\u5982\u4e0b\uff0c\u5927\u5bb6\u4f1a\u53d1\u73b0\uff0c\u56fe\u7247\u4e0b\u9762\u7684\u95f4\u9699\uff0c\u4f9d\u65e7\u662f\u90a3\u4e2a\u95f4\u9699\u3002<\/p>\n<div style=\"background-color:#E5EDFF;\"><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s256\/mm1.jpg\" height=\"191\">zxx<\/div>\n<p>\u4e0b\u9762\u8981\u89e3\u91ca\u8fd9\u4e2a\u95f4\u9699\u5c31\u597d\u89e3\u91ca\u4e86\u3002\u4e0b\u9762\uff0c\u6211\u4eec\u8ba9\u65b0\u589e\u7684\u6587\u672cinline-block\u5316\uff0c\u7136\u540e\u5f04\u4e2a\u767d\u8272\u80cc\u666f\uff0c\u663e\u793a\u5176\u5360\u636e\u7684\u9ad8\u5ea6\u3002<\/p>\n<div style=\"background-color:#E5EDFF;\"><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s256\/mm1.jpg\" height=\"191\"><span style=\"background-color:#fff;display:inline-block;\">zxx<\/span><\/div>\n<p>\u4f1a\u53d1\u73b0\uff0c\u56fe\u7247\u4e0b\u9762\u7684\u95f4\u9699\uff0c\u4f9d\u65e7\u662f\u90a3\u4e2a\u95f4\u9699\u3002\u4f46\u662f\uff0c\u6211\u4eec\u7684\u7406\u89e3\u5c31\u597d\u7406\u89e3\u4e86\u3002\u56de\u7b54\u4e0b\u9762\u51e0\u4e2a\u95ee\u9898\uff0c\u6211\u4eec\u5c31\u77e5\u9053\u8868\u73b0\u7684\u539f\u56e0\u4e86\uff1a<\/p>\n<ol>\n<li><code>vertical-align<\/code>\u9ed8\u8ba4\u7684\u5bf9\u9f50\u65b9\u5f0f\u662f\uff1f<\/li>\n<li>\u540e\u9762zxx\u6587\u5b57\u7684\u9ad8\u5ea6\u4ece\u4f55\u800c\u6765\uff1f<\/li>\n<\/ol>\n<p>\u4e0a\u97622\u4e2a\u95ee\u9898\u5c31\u5f88\u7b80\u5355\u4e86\uff1a<\/p>\n<ol>\n<li><code>vertical-align<\/code>\u9ed8\u8ba4\u503c\u662f<code>baseline<\/code>, \u4e5f\u5c31\u662f\u57fa\u7ebf\u5bf9\u9f50\u3002\u800c\u57fa\u7ebf\u662f\u4ec0\u4e48\uff0c\u57fa\u7ebf\u5c31\u662f\u5b57\u6bcdX\u7684\u4e0b\u8fb9\u7f18\uff08\u53c2\u89c1\u201c<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2015\/06\/about-letter-x-of-css\/\">\u5b57\u6bcd\u2019x\u2019\u5728CSS\u4e16\u754c\u4e2d\u7684\u89d2\u8272\u548c\u6545\u4e8b<\/a>\u201d\u4e00\u6587\uff09\u3002\u6240\u4ee5\uff0c\u59b9\u5b50\u56fe\u7247\u7684\u4e0b\u8fb9\u7f18\u5c31\u548c\u540e\u9762zxx\u4e2d\u7684\u5b57\u6bcd<code>x<\/code>\u4e0b\u8fb9\u7f18\u5bf9\u9f50\uff08\u89c1\u4e0b\u56fe\uff09\u3002\u800c\u5b57\u7b26<code>zxx<\/code>\u672c\u8eab\u662f\u6709\u9ad8\u5ea6\u7684\uff0c\u5bf9\u5427\uff0c\u4e8e\u662f\uff0c\u56fe\u7247\u4e0b\u9762\u5c31\u7559\u7a7a\u4e86\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201508\/2015-08-29_141809.png\" width=\"522\" height=\"340\" alt=\"\u56fe\u7247\u5e95\u8fb9\u548c\u5b57\u6bcdx\u5e95\u8fb9\u5bf9\u9f50\" class=\"alignnone\" \/><\/li>\n<li>\u800c<code>zxx<\/code>\u6587\u5b57\u7684\u9ad8\u5ea6\u662f\u7531\u884c\u9ad8\u51b3\u5b9a\u7684\u3002<\/li>\n<\/ol>\n<p>\u56e0\u6b64\uff0c\u7b80\u5355\u7684\u56fe\u7247\u4e0b\u9762\u7559\u767d\u884c\u4e3a\u8868\u73b0\uff0c\u672c\u8d28\u4e0a\uff0c\u5c31\u662f<code>vertical-align<\/code>\u548c<code>line-height<\/code>\u80cc\u5730\u91cc\u641e\u57fa\u9020\u6210\u7684\u3002<\/p>\n<p>\u77e5\u9053\u4e86\u95ee\u9898\u7684\u539f\u56e0\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5bf9\u75c7\u4e0b\u836f\uff0c\u51c6\u786e\u641e\u5b9a\u56fe\u7247\u4e0b\u9762\u6211\u4eec\u4e0d\u5e0c\u671b\u770b\u5230\u7684\u95f4\u9699\u3002\u600e\u4e48\u641e\u5462\uff1f\u4e00\u5bf9\u57fa\u53cb\uff0c<code>vertical-align<\/code>\u548c<code>line-height<\/code>\u6211\u4eec\u968f\u4fbf\u641e\u5b9a\u4e00\u4e2a\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>\u6bd4\u65b9\u8bf4<code>vertical-align<\/code>.<\/p>\n<p><strong>1. \u8ba9vertical-align\u5931\u6548<\/strong><br \/>\n\u56fe\u7247\u9ed8\u8ba4\u662f<code>inline<\/code>\u6c34\u5e73\u7684\uff0c\u800c<code>vertical-align<\/code>\u5bf9\u5757\u72b6\u6c34\u5e73\u7684\u5143\u7d20\u65e0\u611f\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u53ea\u8981\u8ba9\u56fe\u7247<code>display<\/code>\u6c34\u5e73\u4e3a<code>block<\/code>\u5c31\u53ef\u4ee5\u4e86\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u8bbe\u7f6e<code>display<\/code>\u6216\u8005\u6d6e\u52a8\u3001\u7edd\u5bf9\u5b9a\u4f4d\u7b49\uff08\u5982\u679c\u5e03\u5c40\u5141\u8bb8\uff09\u3002\u4f8b\u5982\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>img { display: block; }<\/pre>\n<\/div>\n<p>\u5219\u59b9\u5b50\u5c31\u4f1a\u53d8\u8fd9\u6837\uff1a<\/p>\n<div style=\"background-color:#E5EDFF;\"><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s256\/mm1.jpg\" style=\"display:block;\" height=\"191\"><\/div>\n<p>\u4e0b\u9762\u7684\u7a7a\u9699\u4e0d\u89c1\u4e86\u3002<\/p>\n<p><strong>2. \u4f7f\u7528\u5176\u4ed6vertical-align\u503c<\/strong><br \/>\n\u544a\u522b<code>baseline<\/code>, \u53d6\u7528\u5176\u4ed6\u5c5e\u6027\u503c\uff0c\u6bd4\u65b9\u8bf4<code>bottom<\/code>\/<code>middle<\/code>\/<code>top<\/code>\u90fd\u662f\u53ef\u4ee5\u7684\u3002<\/p>\n<p id=\"radioVT\"> <input type=\"radio\" id=\"radioBottom\" value=\"bottom\" name=\"radiovt\" onclick=\"funImgVt(this)\"><label for=\"radioBottom\" class=\"mr20\">vertical-align:bottom<\/label> <input type=\"radio\" id=\"radioMiddle\" value=\"middle\" name=\"radiovt\" onclick=\"funImgVt(this)\"><label for=\"radioMiddle\" class=\"mr20\">vertical-align:middle<\/label> <input type=\"radio\" id=\"radioTop\" value=\"top\" name=\"radiovt\" onclick=\"funImgVt(this)\"><label for=\"radioTop\">vertical-align:top<\/label> <\/p>\n<div style=\"background-color:#E5EDFF;\"><img decoding=\"async\" id=\"imgVt\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s256\/mm1.jpg\" height=\"191\"><span style=\"background-color:#fff;display:inline-block;\">zxx<\/span><\/div>\n<p><strong>3. \u76f4\u63a5\u4fee\u6539line-height\u503c<\/strong><br \/>\n\u4e0b\u9762\u7684\u7a7a\u9699\u9ad8\u5ea6\uff0c\u5b9e\u9645\u4e0a\u662f\u6587\u5b57\u8ba1\u7b97\u540e\u7684\u884c\u9ad8\u503c\u548c\u5b57\u6bcdx\u4e0b\u8fb9\u7f18\u7684\u8ddd\u79bb\u3002\u56e0\u6b64\uff0c\u53ea\u8981\u884c\u9ad8\u8db3\u591f\u5c0f\uff0c\u5b9e\u9645\u6587\u5b57\u5360\u636e\u7684\u9ad8\u5ea6\u7684\u5e95\u90e8\u5c31\u4f1a\u5728x\u7684\u4e0a\u9762\uff0c\u4e0b\u9762\u6ca1\u6709\u4e86\u9ad8\u5ea6\u533a\u57df\u652f\u6491\uff0c\u81ea\u7136\uff0c\u56fe\u7247\u5c31\u4f1a\u6709\u5bb9\u5668\u5e95\u8fb9\u8d34\u5408\u5728\u4e00\u8d77\u4e86\u3002\u6bd4\u65b9\u8bf4\uff0c\u6211\u4eec\u8bbe\u7f6e\u884c\u9ad85\u50cf\u7d20\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>div { line-height: 5px; }<\/pre>\n<\/div>\n<div style=\"background-color:#E5EDFF; line-height: 5px;\"><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s256\/mm1.jpg\" height=\"191\"><span style=\"background-color:#fff;display:inline-block;\">zxx<\/span><\/div>\n<p><strong>4. line-height\u4e3a\u76f8\u5bf9\u5355\u4f4d\uff0cfont-size\u95f4\u63a5\u63a7\u5236<\/strong><br \/>\n\u5982\u679c<code>line-height<\/code>\u662f\u76f8\u5bf9\u5355\u4f4d\uff0c\u4f8b\u5982<code>line-height:1.6<\/code>\u6216\u8005<code>line-height:160%<\/code>\u4e4b\u7c7b\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528<code>font-size<\/code>\u95f4\u63a5\u63a7\u5236\uff0c\u6bd4\u65b9\u8bf4\u6765\u4e2a\u72e0\u7684\uff0c<code>font-size<\/code>\u8bbe\u4e3a\u5927\u9e21\u86cb<code>0<\/code>, \u672c\u8d28\u4e0a\u8fd8\u662f\u6539\u53d8<code>line-height<\/code>\u503c.<\/p>\n<div class=\"zxx_code\">\n<pre>div { font-size: 0; }<\/pre>\n<\/div>\n<div style=\"background-color:#E5EDFF; font-size: 0;\"><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s256\/mm1.jpg\" height=\"191\"><span style=\"background-color:#fff;display:inline-block;\">zxx<\/span><\/div>\n<p><strong style=\"display:block;padding-top:10px;\"><big>\u2462 \u57fa\u672c\u73b0\u8c61\u884d\u751f\uff1a\u5782\u76f4\u5c45\u4e2d<\/big><\/strong><\/p>\n<p>\u7531\u4e8e\u300c\u5e7d\u7075\u7a7a\u767d\u8282\u70b9\u300d\u7684\u5b58\u5728\uff0c\u56e0\u6b64\uff0c\u6211\u4eec\u53ef\u4ee5\u8fdb\u4e00\u6b65\u884d\u751f\uff0c\u5b9e\u73b0\u5176\u4ed6\u66f4\u5b9e\u7528\u7684\u6548\u679c\uff0c\u6bd4\u65b9\u8bf4\u4efb\u610f\u5c3a\u5bf8\u7684\u56fe\u7247\uff08\u6216\u8005\u5185\u8054\u5757\u72b6\u5316\u7684\u591a\u884c\u6587\u5b57\uff09\u7684\u5782\u76f4\u5c45\u4e2d\u6548\u679c\u3002\u5c31\u662f\u501f\u52a9\u672c\u6587\u7684\u4e24\u4f4d\u7537\u4e3b\u89d2\uff0c<code>vertical-align<\/code>\u548c<code>line-height<\/code>\u3002<\/p>\n<p>\u4f60\u60f3\u554a\uff0c\u56fe\u7247\u540e\u9762\uff08\u524d\u9762\uff09\u6709\u4e2a\u7c7b\u4f3c\u7a7a\u683c\u5b57\u7b26\u7684\u8282\u70b9\uff0c\u7136\u540e\u5c31\u80fd\u54cd\u5e94<code>line-height<\/code>\u5f62\u6210\u9ad8\u5ea6\uff0c\u6b64\u65f6\uff0c\u56fe\u7247\u518d\u6765\u4e2a<code>vertical-align:middle<\/code>\uff0c\u5f53\u5f53\u5f53\u5f53\uff0c\u5c31\u53ef\u4ee5\u548c\u8fd9\u4e2a\u88ab\u884c\u9ad8\u6491\u9ad8\u7684\u300c\u5e7d\u7075\u7a7a\u767d\u8282\u70b9\u300d(\u8fd1\u4f3c)\u5782\u76f4\u5bf9\u9f50\u4e86\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>div { line-height: 240px; }\r\nimg { vertical-align: middle; }<\/pre>\n<\/div>\n<p>\u7136\u540e\u5c31\u4f1a\u8fd9\u6837\u5b50\uff1a<\/p>\n<div style=\"background-color:#E5EDFF; line-height: 240px;\"><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s256\/mm1.jpg\" height=\"191\" style=\"vertical-align: middle;\"><\/div>\n<p>\u4e0d\u8fc7\u4e0a\u9762\u7684\u6548\u679c\u5e76\u4e0d\u662f\u5b8c\u5168\u7684\u5782\u76f4\u5c45\u4e2d\uff0c\u53ea\u662f\u8fd1\u4f3c\uff08\u7a0d\u5fae\u4ed4\u7ec6\u770b\u53ef\u4ee5\u770b\u51fa\u6765\uff09\u3002\u4e3a\u4ec0\u4e48\u53ea\u662f\u8fd1\u4f3c\u5462\uff1f\u90a3\u662f\u56e0\u4e3a\u300c\u5e7d\u7075\u7a7a\u767d\u8282\u70b9\u300d\u9ad8\u5ea6\u884c\u9ad8\u6491\u5f00\uff0c\u5176\u5782\u76f4\u4e2d\u5fc3\u662f\u5b57\u7b26content area\u7684\u4e2d\u5fc3\uff0c\u800c\u5bf9\u4e8e\u5b57\u7b26<code>x<\/code>\u800c\u8a00\uff0c\u90fd\u662f\u6bd4\u7edd\u5bf9\u4e2d\u5fc3\u4f4d\u7f6e\u8981\u4e0b\u6c89\u7684\uff08\u4e0d\u540c\u5b57\u4f53\u4e0b\u6c89\u5e45\u5ea6\u4e0d\u4e00\u6837\uff09\uff0c\u6362\u53e5\u66f4\u6613\u61c2\u7684\u63cf\u8ff0\u5c31\u662f<code>x<\/code>\u7684\u4e2d\u5fc3\u4f4d\u7f6e\u90fd\u662f\u5728\u5b57\u7b26\u5185\u5bb9\u533a\u57df\u9ad8\u5ea6\u4e2d\u5fc3\u70b9\u7684\u4e0b\u65b9\uff0c\u800c\u8fd9\u4e0a\u4e0b\u7684\u504f\u5dee\u5c31\u662f\u8fd9\u91cc\u56fe\u7247\u4e0a\u4e0b\u95f4\u8ddd\u7684\u504f\u5dee\u3002<\/p>\n<p>\u6211\u7279\u610f\u628a\u5b57\u7b26<code>x<\/code>\u4f7f\u7528\u5927\u5b57\u53f7\u6f14\u793a\u4e86\u4e0b\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201508\/2015-08-31_130708.png\" width=\"266\" height=\"181\" alt=\"\u4e2d\u7ebf\u4f4d\u7f6e\u5e76\u4e0d\u662f\u5b57\u7b26\u5185\u5bb9\u7684\u7edd\u5bf9\u5c45\u4e2d\u4f4d\u7f6e\" class=\"alignnone\" \/><\/p>\n<p>\u6362\u53e5\u66f4\u7b80\u5355\u7684\u8bdd\u8bf4\u5c31\u662f\uff1amiddle\u4e2d\u7ebf\u4f4d\u7f6e(\u5b57\u7b26<code>x<\/code>\u7684\u4e2d\u5fc3)\u5e76\u4e0d\u662f\u5b57\u7b26\u5185\u5bb9\u7684\u7edd\u5bf9\u5c45\u4e2d\u4f4d\u7f6e\u3002\u4e24\u4e2a\u4f4d\u7f6e\u7684\u504f\u5dee\u5c31\u662f\u56fe\u7247\u8fd1\u4f3c\u5c45\u4e2d\u7684\u504f\u5dee\u3002<\/p>\n<p>\u561b\u561b\uff0c\u5355\u7eaf\u7684\u6587\u5b57\u8fd8\u662f\u592a\u82cd\u767d\u4e86\uff0c\u622a\u4e2a\u56fe\u793a\u610f\u4e0b\u5427\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201508\/2015-08-29_214832-new.png\" width=\"428\" height=\"277\" alt=\"\u8fd1\u4f3c\u5782\u76f4\u5c45\u4e2d\u6f14\u793a\" class=\"alignnone\" \/><\/p>\n<p>\u56e0\u6b64\uff0c\u8981\u60f3\u5b8c\u5168\u5782\u76f4\u5c45\u4e2d\uff0c\u6700\u5148\u60f3\u5230\u7684\u65b9\u6cd5\u5c31\u662f\u8ba9\u540e\u9762\u7684\u201c\u5e7d\u7075\u5b57\u7b26\u201d\u4e5f\u662f<code>vertical-align:middle<\/code>\uff0c\u7136\u800c\uff0c\u5475\u5475\uff0c\u65e2\u7136\u79f0\u4e4b\u4e3a\u201c\u5e7d\u7075\u201d\u5c31\u8868\u793a\u4e0d\u4f1a\u53d7\u975e\u7ee7\u627f\u7279\u6027\u7684\u5c5e\u6027\u5f71\u54cd\uff0c\u6240\u4ee5\uff0c\u6839\u672c\u6ca1\u6cd5\u8bbe\u7f6e<code>vertical-align:middle<\/code>\uff0c\u9664\u975e\u4f60\u81ea\u5df1\u521b\u5efa\u4e00\u4e2a\u663e\u793a\u7684\u5185\u8054\u5143\u7d20\u3002<\/p>\n<p>\u6211\u4eec\u5c31\u6ca1\u6709\u529e\u6cd5\u4e86\u5417\uff1f\u5f53\u7136\u4e0d\u662f\uff0c\u201c\u5e7d\u7075\u5b57\u7b26\u201d\u53ef\u4ee5\u53d7\u5177\u6709\u7ee7\u627f\u7279\u6027\u7684CSS\u5c5e\u6027\u5f71\u54cd\uff0c\u4e8e\u662f\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5176\u4ed6\u4e1c\u897f\u6765\u505a\u8c03\u6574\uff0c\u8ba9\u5b57\u7b26\u7684\u4e2d\u7ebf\u548c\u5b57\u7b26\u5185\u5bb9\u4e2d\u5fc3\u7ebf\u5728\u4e00\u8d77\uff0c\u6216\u8005\u8bf4\u5728\u4e00\u4e2a\u4f4d\u7f6e\u4e0a\u5c31\u53ef\u4ee5\u4e86\u3002\u6709\u4eba\u53ef\u80fd\u8981\u7591\u95ee\u4e86\uff0c\u8fd9\u80fd\u884c\u5417\uff1f\u554a\uff0c\u662f\u53ef\u4ee5\u7684\u3002<\/p>\n<p>\u600e\u4e48\u641e\uff1f\u5f88\u7b80\u5355\uff0c<code>font-size:0<\/code>, \u56e0\u6b64\u6b64\u65f6content area\u9ad8\u5ea6\u662f0\uff0c\u5404\u79cd\u4e71\u4e03\u516b\u7cdf\u7684\u7ebf\u90fd\u5728\u9ad8\u5ea6\u4e3a0\u7684\u8fd9\u6761\u7ebf\u4e0a\uff0c\u7edd\u5bf9\u4e2d\u5fc3\u7ebf\u548c\u4e2d\u7ebf\u91cd\u5408\u3002\u81ea\u7136\u5168\u5782\u76f4\u5c45\u4e2d\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>div { line-height: 240px; font-size: 0; }\r\nimg { vertical-align: middle; }<\/pre>\n<\/div>\n<p>\u7ed3\u679c\u662f\uff1a<\/p>\n<div style=\"background-color:#E5EDFF; line-height: 240px; font-size: 0;\"><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s256\/mm1.jpg\" height=\"191\" style=\"vertical-align: middle;\"><\/div>\n<p>\u5904\u5973\u5ea7\u7684\u4f60\uff0c\u662f\u4e0d\u662f\u770b\u8fc7\u53bb\u8212\u670d\u591a\u5566\uff01\uff1f<img decoding=\"async\" src=\"https:\/\/mat1.gtimg.com\/www\/mb\/images\/face\/29.gif\" align=\"absmiddle\"  height=\"24\"><\/p>\n<p>\u8fd9\u79cd\u901a\u8fc7<code>line-height<\/code>\u5b9a\u9ad8\uff0c\u5143\u7d20<code>vertical-align:middle<\/code>\u5782\u76f4\u5c45\u4e2d\u7684\u65b9\u6cd5\u4e0d\u4ec5\u9002\u7528\u4e8e\u73b0\u4ee3\u6d4f\u89c8\u5668\uff0c\u8fdeIE7\u6d4f\u89c8\u5668\u4e5f\u662f\u652f\u6301\u7684\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201508\/2015-08-29_222354.png\" width=\"173\" height=\"156\" alt=\"IE7\u6d4f\u89c8\u5668\u4e5f\u652f\u6301\" class=\"alignnone\" \/><\/p>\n<p>\u4e0d\u8fc7\u548c\u5176\u4ed6\u6d4f\u89c8\u5668\u518d\u4f7f\u7528\u4e0a\u8fd8\u662f\u6709\u4e9b\u9700\u8981\u6ce8\u610f\u7684\u5730\u65b9\uff0c\u5c31\u662f\uff0cHTML\u4e0d\u80fd\u8fd9\u6837\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre><del>&lt;div>&lt;img src=\"mm1.jpg\">&lt;\/div><\/del><\/pre>\n<\/div>\n<p>\u800c\u662f\u9700\u8981\u5728\u56fe\u7247\u6807\u7b7e\u7ed3\u675f\u5904\u7559\u4e0b\u7a7a\u683c\u540e\u8005\u6362\u884c\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>&lt;div>&lt;img src=\"mm1.jpg\"><span style=\"color:green;\">&lt;!-- \u8fd9\u91cc\u8981\u6298\u884c\u6216\u7a7a\u683c --&gt;<\/span>\r\n&lt;\/div><\/pre>\n<\/div>\n<p><strong style=\"display:block;padding-top:10px;\"><big>\u2463 \u590d\u6742\u73b0\u8c61<\/big><\/strong><br \/>\n\u591a\u5e74\u524d\u66fe\u5206\u4eab\u8fc7\u201c<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=1514\">text-align:justify\u4e0b\u5217\u8868\u7684\u4e24\u7aef\u5bf9\u9f50\u5e03\u5c40<\/a>\u201d\u7684\u6280\u672f\uff0c\u5176\u4e2d\uff0c\u4e3a\u4e86\u8ba9\u4efb\u610f\u4e2a\u6570\u7684\u5217\u8868\u6700\u540e\u4e00\u884c\u4e5f\u662f\u5bf9\u9f50\u6392\u5217\uff0c\u5728\u5217\u8868\u6700\u540e\u4f1a\u8f85\u52a9\u5217\u8868\u7b49\u5bbd\u7684\u7a7a\u6807\u7b7e\u5143\u7d20\u6765\u5360\u4f4d\uff0c\u7c7b\u4f3c\u4e0b\u9762\u7ea2\u8272\u9ad8\u4eaeHTML\u4ee3\u7801\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>.justify-fix { display: inline-block; width: 128px; }<\/pre>\n<\/div>\n<div class=\"zxx_code\">\n<pre>&lt;div style=\"text-align: justify;\">\r\n    &lt;img src=\"img\/mm1.jpg\" width=\"128\">\r\n    &lt;img src=\"img\/mm1.jpg\" width=\"128\">\r\n    &lt;img src=\"img\/mm1.jpg\" width=\"128\">\r\n    &lt;img src=\"img\/mm1.jpg\" width=\"128\">\r\n    <span style=\"color:#cd0000;\">&lt;i class=\"justify-fix\">&lt;\/i>\r\n    &lt;i class=\"justify-fix\">&lt;\/i>\r\n    &lt;i class=\"justify-fix\">&lt;\/i><\/span>\r\n&lt;\/div><\/pre>\n<\/div>\n<style>.justify-fix { display: inline-block; width: 128px; }.outline .justify-fix { outline: 1px dashed red; }<\/style>\n<p>\u4e3a\u4e86\u8282\u7ea6\u7a7a\u95f4\uff0c\u6211\u5c31\u4f7f\u7528\u5c0f\u56fe\u793a\u610f\uff1a<\/p>\n<div style=\"text-align: justify;max-width:500px;\"> <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\"> <i class=\"justify-fix\"><\/i> <i class=\"justify-fix\"><\/i> <i class=\"justify-fix\"><\/i><\/div>\n<p>\u540c\u6837\u7684\uff0c\u5728\u767d\u8272\u80cc\u666f\u4e0b\uff0c\u4f3c\u4e4e\u770b\u4e0a\u53bb\u6548\u679c\u8fd8\u4e0d\u8d56\uff0c\u4f46\u662f\uff0c\u5982\u679c\u7ed9<code>div<\/code>\u5bb9\u5668\u52a0\u4e2a\u80cc\u666f\u8272~~<\/p>\n<div style=\"text-align: justify;max-width:500px;background-color:#E5EDFF;\"> <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\"> <i class=\"justify-fix\"><\/i> <i class=\"justify-fix\"><\/i> <i class=\"justify-fix\"><\/i><\/div>\n<p>\u4f1a\u60ca\u8bb6\u7684\u53d1\u73b0\uff0c\u4e0b\u9762\u591a\u4e86\u5f88\u5927\u4e00\u5757\u95f4\u9699\uff08\u5982\u4e0b\u622a\u56fe\uff09\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201508\/2015-08-29_230514.png\" width=\"256\" height=\"95\" alt=\"\u5927\u5927\u7684\u7a7a\u767d\u95f4\u9699\" class=\"alignnone\" \/><\/p>\n<p>\u4e3a\u4e86\u4fbf\u4e8e\u5927\u5bb6\u770b\u5176\u7a76\u7adf\uff0c\u6211\u628a\u5360\u4f4d<code>i<\/code>\u5143\u7d20<code>outline<\/code>\u9ad8\u4eae\u4e0b\uff0c\u4e8e\u662f\uff0c\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n<div style=\"text-align: justify;max-width:500px;background-color:#E5EDFF;\" class=\"outline\"> <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\"> <i class=\"justify-fix\"><\/i> <i class=\"justify-fix\"><\/i> <i class=\"justify-fix\"><\/i><\/div>\n<p>\u7ed3\u679c\u4f1a\u53d1\u73b0\uff0c\u4e0a\u9762\u5de8\u5927\u7684\u7a7a\u9699\u662f\u7531\u5360\u4f4d<code>i<\/code>\u5143\u7d20\u4e0a\u9762\u548c\u4e0b\u9762\u7684\u95f4\u9699\u5171\u540c\u7ec4\u6210\u7684\u3002<\/p>\n<p>\u4e0b\u9762\u95ee\u9898\u6765\u4e86\uff1a\u4e0a\u9762\u7684\u95f4\u9699\u662f\u5982\u4f55\u4ea7\u751f\u7684\uff1f\u4e0b\u9762\u7684\u95f4\u9699\u662f\u5982\u4f55\u4ea7\u751f\u7684\uff1f\u5982\u679c\u53bb\u9664\u8fd9\u4e9b\u95f4\u9699\u5462\uff1f<\/p>\n<p>\u5f88\u591a\u65f6\u5019\uff0c\u590d\u6742\u95ee\u9898\u662f\u7531\u7b80\u5355\u95ee\u9898\u7ec4\u5408\u800c\u6210\u7684\uff0c\u5b9e\u9645\u4e0a\uff0c\u8fd9\u91cc\u7684\u95f4\u9699\u73b0\u8c61\u7684\u59cb\u4f5c\u4fd1\u8005\u548c\u4e0a\u9762\u7684\u7b80\u5355\u73b0\u8c61\u4e00\u6837\uff0c\u90fd\u662f<code>vertical-align<\/code>\u548c<code>line-height<\/code>\u641e\u57fa\u5e26\u6765\u7684\u4e0d\u597d\u7684\u5f71\u54cd\u3002<\/p>\n<p>\u6309\u7167\u4e4b\u524d\u95ee\u9898\u89e3\u51b3\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u6765\u4e2a<code>line-height:0<\/code>\u89e3\u51b3\u5782\u76f4\u95f4\u9699\u95ee\u9898\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>div { line-height: 0; }<\/pre>\n<\/div>\n<p>\u7ed3\u679c\u56fe\u7247\u548c\u56fe\u7247\u4e4b\u95f4\u7684\u95f4\u9699\u662f\u6ca1\u6709\u4e86\uff0c\u4f46\u662f\uff0c\u56fe\u7247\u548c\u6700\u540e\u7684\u5360\u4f4d\u5143\u7d20\u4e4b\u95f4\u4f9d\u7136\u6709\u4e2a\u51e0\u50cf\u7d20\u7684\u95f4\u8ddd\uff0c<img decoding=\"async\" src=\"https:\/\/mat1.gtimg.com\/www\/mb\/images\/face\/18.gif\" align=\"absmiddle\">\uff0c\u554a\u554a\u554a\u554a\uff0c\u8fd9\u7a76\u7adf\u662f\u4ec0\u4e48\u9b3c\uff1f<\/p>\n<div style=\"text-align: justify;max-width:500px;background-color:#E5EDFF;line-height:0;\" class=\"outline\"> <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\"> <i class=\"justify-fix\"><\/i> <i class=\"justify-fix\"><\/i> <i class=\"justify-fix\"><\/i><\/div>\n<p>\u7b80\u5355\u73b0\u8c61\u7684\u80cc\u540e\u5f80\u5f80\u6709\u5927\u7684\u5b66\u95ee\uff0c\u63a5\u4e0b\u6765\u662f\u672c\u6587\u7684\u9ad8\u6f6e\u4e86\uff0c\u7a76\u5176\u539f\u56e0\uff0c\u8981\u8bf4\u5230inline-block\u5143\u7d20\u548c\u57fa\u7ebfbaseline\u4e4b\u95f4\u7684\u4e00\u4e9b\u7ea0\u7f20\u7684\u5173\u7cfb\u3002<\/p>\n<p><strong style=\"display:block;padding-top:10px;\"><big>\u2464 inline-block\u548cbaseline<\/big><\/strong><br \/>\nCSS2\u7684\u53ef\u89c6\u5316\u683c\u5f0f\u6a21\u578b\u6587\u6863\u4e2d\u6709\u4e00\u4e48\u4e00\u6bb5\u8bdd\uff1a<\/p>\n<blockquote><p>The baseline of an &#8216;inline-block&#8217; is the baseline of its last line box in the normal flow, unless it has either no in-flow line boxes or if its &#8216;overflow&#8217; property has a computed value other than &#8216;visible&#8217;, in which case the baseline is the bottom margin edge.<\/p><\/blockquote>\n<p>\u82f1\u6587\u770b\u5f97\u773c\u775b\u5927\uff0c\u4e8e\u662f\u6211\u4e2d\u6587\u76f4\u8bd1\u4e86\u4e0b\uff1a<\/p>\n<blockquote><p>&#8216;inline-block&#8217;\u7684\u57fa\u7ebf\u662f\u6b63\u5e38\u6d41\u4e2d\u6700\u540e\u4e00\u4e2aline box\u7684\u57fa\u7ebf, \u9664\u975e\uff0c\u8fd9\u4e2aline box\u91cc\u9762\u65e2\u6ca1\u6709line boxes\u6216\u8005\u672c\u8eab&#8217;overflow&#8217;\u5c5e\u6027\u7684\u8ba1\u7b97\u503c\u800c\u4e0d\u662f&#8217;visible&#8217;, \u8fd9\u79cd\u60c5\u51b5\u4e0b\u57fa\u7ebf\u662fmargin\u5e95\u8fb9\u7f18\u3002<\/p><\/blockquote>\n<p>\u8fd9\u6bb5\u6587\u6863\u4e2d\u51fa\u73b0\u4e86\u5f88\u591a\u4e13\u6709\u540d\u8bcd<code>line box<\/code>, <code>line boxes<\/code>\u7b49\uff0c\u8fd9\u4e9b\u662f\u5185\u8054\u76d2\u5b50\u6a21\u578b\u4e2d\u7684\u6982\u5ff5\uff0c\u662fCSS\u8fdb\u9636\u5fc5\u5907\u77e5\u8bc6\u3002\u6211\u5728\u201c<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=583\">\u6d6e\u52a8\u6df1\u5165\u7406\u89e3(\u4e00)<\/a>\u201d\u4e00\u6587\u7684\u4e2d\u95f4\u7a7f\u63d2\u4ecb\u7ecd\u4e86\u8be5\u6a21\u578b\u3002<span class=\"s\">\/\/zxx: \u6211\u73b0\u5728\u540e\u6094\u4e86\uff0c\u5185\u8054\u76d2\u5b50\u6a21\u578b\u5f53\u521d\u5e94\u8be5\u76f4\u63a5\u72ec\u7acb\u6210\u4e00\u7bc7\u6587\u7ae0\uff0c\u8fd9\u6837\u5176\u4ed6\u6587\u7ae0\u53ef\u4ee5\u5f88\u5e72\u51c0\u5730\u5f15\u7528\uff0c\u6240\u8c13\u6587\u7ae0\u7684\u6a21\u5757\u5316\u4e66\u5199<\/span><\/p>\n<p>\u5982\u679c\u5927\u5bb6\u6ca1\u6709\u8db3\u591f\u7cbe\u529b\u53bb\u5b66\u4e60\u4e4b\uff0c\u53ef\u4ee5\u5148\u770b\u4e0b\u9762\u8fd9\u5f20\u56fe\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201001\/2010-01-20_230801.png\" width=\"516\" height=\"186\" title=\"\u9ed8\u8ba4\u56fe\u6587line boxes\u793a\u610f\"><\/p>\n<p>\u7531\u4e8e\u4e0a\u9762\u7684\u8bd1\u6587\u662f\u76f4\u8bd1\u7684\uff0c\u7406\u89e3\u8d77\u6765\u8fd8\u662f\u6709\u4e9b\u62d7\u53e3\uff0c\u6211\u4f7f\u7528\u901a\u4fd7\u7684\u8bdd\u63cf\u8ff0\u5c31\u662f\uff1a<strong>\u4e00\u4e2ainline-block\u5143\u7d20\uff0c\u5982\u679c\u91cc\u9762\u6ca1\u6709inline\u5185\u8054\u5143\u7d20\uff0c\u6216\u8005overflow\u4e0d\u662fvisible\uff0c\u5219\u8be5\u5143\u7d20\u7684\u57fa\u7ebf\u5c31\u662f\u5176margin\u5e95\u8fb9\u7f18\uff0c\u5426\u5219\uff0c\u5176\u57fa\u7ebf\u5c31\u662f\u5143\u7d20\u91cc\u9762\u6700\u540e\u4e00\u884c\u5185\u8054\u5143\u7d20\u7684\u57fa\u7ebf\u3002<\/strong><\/p>\n<p>\u7eb3\u5c3c\uff0c\u8fd8\u662f\u6ca1\u53cd\u5e94\u8fc7\u6765\uff1f<\/p>\n<p>\u90a3\u6211\u4eec\u770b\u4e0b\u9762\u8fd9\u4e2a\u4f8b\u5b50\uff0c\u5e94\u8be5\u5c31\u77e5\u9053\u4ec0\u4e48\u610f\u601d\u4e86\u3002<\/p>\n<p>\u4e24\u4e2a\u540c\u5c3a\u5bf8\u7684<code>inline-block<\/code>\u6c34\u5e73\u5143\u7d20\uff0c\u552f\u4e00\u533a\u522b\u5c31\u662f\u4e00\u4e2a\u7a7a\u7684\uff0c\u4e00\u4e2a\u91cc\u9762\u6709\u5b57\u7b26\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>.dib-baseline {\r\n  display: inline-block; width: 150px; height: 150px;\r\n  border: 1px solid #cad5eb; background-color: #f0f3f9;\r\n}<\/pre>\n<\/div>\n<div class=\"zxx_code\">\n<pre>&lt;span class=\"dib-baseline\">&lt;\/span>\r\n&lt;span class=\"dib-baseline\">x-baseline&lt;\/span><\/pre>\n<\/div>\n<style>.dib-baseline { display: inline-block; width: 100px; height: 100px; border: 1px solid #cad5eb; background-color: #f0f3f9; }<\/style>\n<p>\u7ed3\u679c\uff0c\u79d1\u79d1\uff1a<\/p>\n<p><span class=\"dib-baseline\"><\/span> <span class=\"dib-baseline\" onClick=\"this.innerHTML=this.innerHTML? '': 'x-baseline'\">x-baseline<\/span><\/p>\n<p>\u4f1a\u53d1\u73b0\uff0c\u660e\u660e\u5c3a\u5bf8\u3001display\u6c34\u5e73\u90fd\u662f\u4e00\u6837\u7684\uff0c\u7ed3\u679c\u5462\uff0c\u4e24\u4e2a\u5374\u4e0d\u5728\u4e00\u4e2a\u6c34\u5e73\u7ebf\u4e0a\u5bf9\u9f50\uff0c\u4e3a\u4ec0\u4e48\u5462\uff1f\u54c8\u54c8\uff0c\u4e0a\u9762\u7684\u89c4\u8303\u5df2\u7ecf\u8bf4\u660e\u4e86\u4e00\u5207\u3002\u7b2c\u4e00\u4e2a\u6846\u6846\u91cc\u9762\u6ca1\u6709\u5185\u8054\u5143\u7d20\uff0c\u56e0\u6b64\uff0c\u57fa\u7ebf\u5c31\u662f\u5bb9\u5668\u7684margin\u4e0b\u8fb9\u7f18\uff0c\u4e5f\u5c31\u662f\u4e0b\u8fb9\u6846\u4e0b\u9762\u7684\u4f4d\u7f6e\uff1b\u800c\u7b2c\u4e8c\u4e2a\u6846\u6846\u91cc\u9762\u6709\u5b57\u7b26\uff0c\u7eaf\u6b63\u7684\u5185\u8054\u5143\u7d20\uff0c\u56e0\u6b64\uff0c\u7b2c\u4e8c\u4e2a\u6846\u6846\u5c31\u662f\u8fd9\u4e9b\u5b57\u7b26\u7684\u57fa\u7ebf\uff0c\u4e5f\u5c31\u662f\u5b57\u6bcdx\u7684\u4e0b\u8fb9\u7f18\u4e86\u3002\u4e8e\u662f\uff0c\u6211\u4eec\u5c31\u770b\u5230\u4e86\u6846\u68461\u4e0b\u8fb9\u7f18\u548c\u6846\u68462\u91cc\u9762\u5b57\u7b26<code>x<\/code>\u5e95\u8fb9\u5bf9\u9f50\u7684\u597d\u620f\u3002\u6846\u68462\u6709\u4e2a\u5c0f\u5f69\u86cb\uff0c\u70b9\u51fb\u53ef\u4ee5toggle\u5176<code>innerHTML<\/code>\uff0c\u4f1a\u53d1\u73b0\uff0c\u5982\u679c\u6846\u68462\u91cc\u9762\u6ca1\u6587\u5b57\uff0c\u5c31\u548c\u6846\u68461\u4e3e\u6848\u9f50\u7709\u4e86\u3002<\/p>\n<p><span class=\"dib-baseline\"><\/span> <span class=\"dib-baseline\"><\/span><\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u8981\u505a\u4e00\u4ef6\u5f88\u6709\u5fc5\u8981\u7684\u4e8b\u60c5\uff0c\u7528\u6765\u5e2e\u52a9\u6211\u4eec\u7406\u89e3\u4e0a\u9762\u590d\u6742\u4f8b\u5b50\u5728<code>line-height<\/code>\u503c\u4e3a<code>0<\/code>\u540e\u7684\u8868\u73b0\uff0c\u4ec0\u4e48\u4e8b\u60c5\u5462\uff1f\u54c8\uff0c\u540c\u5883\u754c\u6a21\u62df\uff0c\u6211\u4eec\u4e5f\u8bbe\u7f6e\u6846\u68462\u7684<code>line-height<\/code>\u503c\u4e3a<code>0<\/code>\uff0c\u4e8e\u662f\uff0c\u5c31\u4f1a\u662f\u4e0b\u9762\u8fd9\u6837\u7684\u8868\u73b0\uff1a<\/p>\n<p><span class=\"dib-baseline\"><\/span> <span class=\"dib-baseline\" style=\"line-height:0;\">x-baseline<\/span><\/p>\n<p>\u77e5\u9053\u6846\u68462\u4e3a\u4f55\u53c8\u4e0b\u6c89\u4e86\u4e00\u70b9\u5417\uff1f<\/p>\n<p>\u56e0\u4e3a\u5b57\u7b26\u5b9e\u9645\u5360\u636e\u7684\u9ad8\u5ea6\u662f\u7531\u884c\u9ad8\u51b3\u5b9a\u7684\uff0c\u5f53\u884c\u9ad8\u53d8\u62100\u7684\u65f6\u5019\uff0c\u5b57\u7b26\u5360\u636e\u7684\u9ad8\u5ea6\u4e5f\u662f<code>0<\/code>\uff0c\u6b64\u65f6\uff0c\u9ad8\u5ea6\u7684\u8d77\u59cb\u4f4d\u7f6e\u5c31\u53d8\u6210\u4e86\u5b57\u7b26content area\u7684\u5782\u76f4\u4e2d\u5fc3\u4f4d\u7f6e\uff0c\u4e8e\u662f\uff0c\u6587\u5b57\u5c31\u4e00\u534a\u843d\u5728\u770b\u770b2\u7684\u5916\u9762\u4e86\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201508\/2015-08-29_235428.png\" width=\"148\" height=\"63\" alt=\"\u72b9\u62b1\u7435\u7436\u534a\u906e\u9762\" class=\"alignnone\" \/><\/p>\n<p>\u7531\u4e8e\u6587\u5b57\u5b57\u7b26\u4e0a\u79fb\u4e86\uff0c\u81ea\u7136\u57fa\u7ebf\u4f4d\u7f6e(\u5b57\u6bcd<code>x<\/code>\u7684\u5e95\u8fb9\u7f18)\u4e5f\u5f80\u4e0a\u79fb\u52a8\u4e86\uff0c\u4e8e\u662f\uff0c\u4e24\u4e2a\u6846\u6846\u7684\u5782\u76f4\u843d\u5dee\u5c31\u66f4\u5927\u4e86\u3002<\/p>\n<p>OK\uff0c\u660e\u767d\u4e86\u4e0a\u9762\u7684\u7b80\u5355\u4f8b\u5b50\uff0c\u4e5f\u5c31\u80fd\u660e\u767d\u4e0a\u9762\u7684\u590d\u6742\u4f8b\u5b50\u3002\u7d27\u63a5\u7740\uff0c\u5982\u679c\u6211\u4eec\u5728\u6700\u540e\u4e00\u4e2a\u5360\u4f4d\u7684<code>&lt;i&gt;<\/code>\u5143\u7d20\u540e\u9762\u65b0\u589e\u540c\u6837\u7684<code>x-baseline<\/code>\u5b57\u7b26\uff0c\u5219\uff1a<\/p>\n<div style=\"text-align: justify;max-width:500px;background-color:#E5EDFF;line-height:0;\" class=\"outline\"> <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\"> <i class=\"justify-fix\"><\/i> <i class=\"justify-fix\"><\/i> <i class=\"justify-fix\"><\/i>x-baseline<\/div>\n<p>\u5927\u5bb6\u662f\u4e0d\u662f\u5c31\u53ef\u4ee5\u660e\u767d\u539f\u56e0\u6240\u5728\u5566\uff01<\/p>\n<p>\u989d~\u5c45\u7136\u8fd8\u6709\u5c0f\u4f19\u4f34\u76b1\u7709\u5934\uff0c\u90a3\u6211\u518d\u7528\u6587\u5b57\u89e3\u91ca\u4e0b\uff1a<br \/>\n\u73b0\u5728\u884c\u9ad8<code>line-height<\/code>\u662f<code>0<\/code>, \u5219\u6700\u540e\u7684<code>x-baseline<\/code>\u7684\u5782\u76f4\u4e2d\u7ebf\u5c31\u548c\u4e0a\u9762\u4e00\u5217\u7684\u56fe\u7247\u5bf9\u9f50\uff0c\u800c\u57fa\u7ebf\u5462\uff0c\u5c31\u5728\u4e2d\u7ebf\u4e0b\u9762\u5dee\u4e0d\u591a\u534a\u4e2ax\u7684\u9ad8\u5ea6\u5730\u65b9\uff0c\u800c\u8fd9\u4e2a\u9ad8\u5ea6\u843d\u5dee\u5c31\u662f\u6700\u540e\u56fe\u7247\u548c\u5bb9\u5668\u7684\u95f4\u9699\u9ad8\u5ea6\u503c\uff0c\u56e0\u4e3a\u524d\u9762\u7684<code>&lt;i class=\"justify-fix\"&gt;<\/code>\u662f\u4e2a\u7a7a\u5143\u7d20\uff0c\u57fa\u7ebf\u662f\u81ea\u8eab\u7684\u5e95\u90e8\uff0c\u54c8\u54c8\uff0c\u9020\u4e1a\u554a\uff01<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201508\/2015-08-30_000413.png\" width=\"184\" height=\"99\" alt=\"\u57fa\u7ebf\u5bf9\u9f50\u9020\u6210\u7684\u95f4\u9699\" class=\"alignnone\" \/><\/p>\n<p>OK\uff0c\u4e00\u65e6\u77e5\u9053\u4e86\u73b0\u8c61\u7684\u672c\u8d28\uff0c\u6211\u4eec\u5c31\u80fd\u8f7b\u677e\u5bf9\u75c7\u4e0b\u836f\u4e86\uff01\u8981\u4e48\u6539\u9020\u5360\u4f4d<code>&lt;i&gt;<\/code>\u5143\u7d20\u7684\u57fa\u7ebf\u3001\u8981\u4e48\u6539\u9020\u201c\u5e7d\u7075\u7a7a\u767d\u8282\u70b9\u201d\u7684\u57fa\u7ebf\u4f4d\u7f6e\u3001\u8981\u4e48\u4f7f\u7528\u5176\u4ed6<code>vertical-align<\/code>\u5bf9\u9f50\u65b9\u5f0f~<\/p>\n<p>\u9996\u5148\uff0c\u6765\u4e2a\u6700\u6709\u610f\u601d\u7684\u65b9\u6cd5\uff0c\u5bf9\u5427\uff0c<strong>\u6539\u9020\u5360\u4f4d<code>&lt;i&gt;<\/code>\u5143\u7d20\u7684\u57fa\u7ebf<\/strong>\u3002\u8fd9\u4e2a\u5f88\u7b80\u5355\uff0c\u5bf9\u5427\uff0c\u53ea\u8981\u5728\u7a7a\u7684<code>&lt;i&gt;<\/code>\u5143\u7d20\u91cc\u9762\u968f\u4fbf\u653e\u51e0\u4e2a\u5b57\u7b26\u5c31\u53ef\u4ee5\u4e86\uff0c\u4f8b\u5982\uff0c\u91cc\u9762\u6709\u4e2a<code>x<\/code>\uff1a<\/p>\n<div style=\"text-align: justify;max-width:500px;background-color:#E5EDFF;line-height:0;\" class=\"outline\"> <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\"> <i class=\"justify-fix\"><\/i> <i class=\"justify-fix\"><\/i> <i class=\"justify-fix\">x<\/i>x-baseline<\/div>\n<p>\u4f1a\u53d1\u73b0\uff0c\u95f4\u9699\u6ca1\u6709\u4e86\uff01<img decoding=\"async\" src=\"https:\/\/mat1.gtimg.com\/www\/mb\/images\/face\/4.gif\" align=\"absmiddle\" height=\"24\"> \u4e3a\u4ec0\u4e48\u5462\uff1f\u54c8\u54c8\uff0c\u56e0\u4e3a<code>&lt;i&gt;<\/code>\u5143\u7d20\u7684\u57fa\u7ebf\u548c\u201c\u5e7d\u7075\u7a7a\u767d\u8282\u70b9\u201d\u7684\u57fa\u7ebf\u4f4d\u7f6e\u73b0\u5728\u4e00\u81f4\u4e86\uff0c\u6ca1\u6709\u4e86\u9519\u4f4d\uff0c\u81ea\u7136\u5c31\u4e0d\u4f1a\u6709\u95f4\u9699\u5566\uff01<\/p>\n<p><strong>\u6539\u9020\u201c\u5e7d\u7075\u7a7a\u767d\u8282\u70b9\u201d\u7684\u57fa\u7ebf\u4f4d\u7f6e<\/strong>\uff0c\u54c8\u54c8\uff0c\u4f7f\u7528<code>font-size<\/code>\uff0c\u5b57\u4f53\u8db3\u591f\u5c0f\u65f6\uff0c\u57fa\u7ebf\u548c\u4e2d\u7ebf\u4f1a\u91cd\u5408\u5728\u4e00\u8d77\uff0c\u4ec0\u4e48\u65f6\u5019\u5b57\u4f53\u8db3\u591f\u5c0f\u5462\uff0c\u5c31\u662f<code>0<\/code>. \u4e8e\u662f\uff0cCSS\u4ee3\u7801(<code>line-height<\/code>\u5982\u679c\u662f\u76f8\u5bf9\u503c\uff0c<code>line-height:0<\/code>\u4e5f\u53ef\u4ee5\u7701\u6389)\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>div { font-size: 0; }<\/pre>\n<\/div>\n<div style=\"text-align: justify;max-width:500px;background-color:#E5EDFF;font-size:0;\" class=\"outline\"> <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\"> <i class=\"justify-fix\"><\/i> <i class=\"justify-fix\"><\/i> <i class=\"justify-fix\"><\/i><\/div>\n<p><strong>\u4f7f\u7528\u5176\u4ed6<code>vertical-align<\/code>\u5bf9\u9f50\u65b9\u5f0f<\/strong>\uff0c\u5c31\u662f\u8ba9\u4e24\u7aef\u5bf9\u9f50\u7684\u5217\u8868\u5143\u7d20<code>vertical-align:top\/bottom\/...<\/code>\u4e4b\u7c7b\u3002<\/p>\n<div class=\"zxx_code\">\n<pre>div { <span style=\"color:#cd0000;\">line-height: 0;<\/span> }\r\n.justify-fix { display: inline-block; width: 128px; <span style=\"color:#cd0000;\">vertical-align: top;<\/span> }<\/pre>\n<\/div>\n<p>\u6700\u540e\u7684\u6548\u679c\u662f\uff1a<\/p>\n<div style=\"text-align: justify;max-width:500px;background-color:#E5EDFF;line-height:0;\" class=\"outline\"> <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\">  <img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/study\/s\/s128\/mm1.jpg\"> <i class=\"justify-fix\" style=\"vertical-align:top;\"><\/i> <i class=\"justify-fix\" style=\"vertical-align:top;\"><\/i> <i class=\"justify-fix\" style=\"vertical-align:top;\"><\/i><\/div>\n<p>\u6069\u6069\uff0c\u5404\u79cd\u65b9\u6cd5\u90fd\u5b8c\u7f8e\u89e3\u51b3\u4e86\u5782\u76f4\u95f4\u9699\u7684\u95ee\u9898\uff0c\u6765\uff0c\u5404\u4e2a\u5927\u5927\u7684\u8d5e\uff01<\/p>\n<h3>\u56db\u3001\u57fa\u53cb\u5173\u7cfb\u66b4\u9732\u4e4b\u540e<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/201508\/liuye-hujun.jpg\" width=\"240\" height=\"168\" alt=\"\u597d\u57fa\u53cb\u4e00\u8f88\u5b50\" class=\"alignnone\" \/><\/p>\n<p>\u81f3\u6b64\uff0c<code>vertical-align<\/code>\u548c<code>line-height<\/code>\u7684\u65ad\u80cc\u57fa\u53cb\u5173\u7cfb\u7b97\u662f\u5f7b\u5e95\u66b4\u9732\u4e86\uff0c\u800c\u4e14\uff0c\u4ece\u884c\u4e3a\u8868\u73b0\u4e0a\u6765\u770b\uff0c<code>line-height<\/code>\u662f\u653b\uff0c<code>vertical-align<\/code>\u662f\u4e2a\u53d7\u3002\u800c\u5f88\u591a\u5185\u8054\u5143\u7d20\u7684\u884c\u4e3a\u8868\u73b0\uff0c\u5c31\u662f\u8fd9\u5bf9\u57fa\u53cb\u641e\u4e03\u641e\u516b\u4e00\u8d77\u641e\u51fa\u6765\u7684\u3002<\/p>\n<p>\u4ee5\u524d\uff0c\u5173\u7cfb\u5904\u4e8e\u5730\u4e0b\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u80fd\u4e0d\u4f1a\u660e\u767d\uff0c\u4e3a\u4f55\u7537\u5395\u6240\u7684\u5377\u7eb8\u7528\u5f97\u6bd4\u5973\u5395\u6240\u8fd8\u5feb\uff1b\u4f46\u662f\uff0c\u73b0\u5728\u5173\u7cfb\u66b4\u9732\u4e86\uff0c\u5f88\u591a\u4ee5\u524d\u6211\u4eec\u60f3\u4e0d\u660e\u767d\u7684\u4e8b\u60c5\u4e00\u4e0b\u5b50\u5c31\u8c41\u7136\u5f00\u6717\u4e86\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u6211\u4eec\u8981\u4ee5\u6b63\u786e\u5730\u5fc3\u6001\u53bb\u770b\u5f85\u8fd9\u5bf9\u597d\u57fa\u53cb\uff0c\u6bd5\u7adf\uff0c\u4ed6\u4eec\u53ef\u4ee5CSS\u5c4a\u975e\u5e38\u91cd\u8981\u7684\u4e24\u4e2a\u4e3b\u529b\u5927\u5c06\u3002<\/p>\n<p>\u672c\u6587\u7275\u626f\u7684\u77e5\u8bc6\u70b9\u751a\u591a\uff0c\u5efa\u8bae\u5927\u5bb6\u5982\u679c\u60f3\u5728\u91cd\u6784\u9886\u57df\u6709\u6240\u9020\u8be3\uff0c\u5f88\u591a\u57fa\u672c\u7684\u5374\u5f88\u6df1\u5165\u7684\u4e1c\u897f\u662f\u5f88\u6709\u5fc5\u8981\u5f04\u900f\u7684\u3002\u7bc7\u5e45\u6709\u9650\uff0c\u6709\u4e0d\u5c11\u77e5\u8bc6\u70b9\u90fd\u662f\u4e00\u7b14\u5e26\u8fc7\u7684\uff0c\u5927\u5bb6\u82e5\u6709\u7591\u95ee\uff0c\u53ef\u4ee5\u81ea\u5df1\u53bb\u68c0\u7d22\u4e0e\u7814\u7a76\uff0c\u4f8b\u5982\uff0c<code>vertical-align<\/code>\u5404\u4e2a\u503c\u7684\u89c4\u8303\u89e3\u91ca\uff0c\u5185\u8054\u76d2\u5b50\u6a21\u578b\uff0c\u7b49\u7b49\u3002\u4e5f\u6b22\u8fce\u5404\u79cd\u65b9\u5f0f\u4ea4\u6d41\u3002<\/p>\n<p>\u6587\u7ae0\u90fd\u662f\u5468\u672b\u71ac\u591c\u5199\u7684\uff0c\u4f60\u77e5\u9053\u7684\uff0c\u73b0\u5728\u4e0d\u662f\u5f53\u5e74\uff0c\u773c\u76ae\u50cf\u704c\u4e86\u6c34\u94f6\uff0c\u56e0\u6b64\uff0c\u6587\u7ae0\u6709\u8868\u8ff0\u6216\u4e66\u5199\u9519\u8bef\u7684\u5730\u65b9\u5728\u6240\u96be\u514d\uff0c\u6b22\u8fce\u6307\u6b63\uff01<\/p>\n<p>\u611f\u8c22\u9605\u8bfb\uff0c\u5468\u672b\u6109\u5feb\uff01\u53e6\u5916\u795d\u8d3a\u4e2d\u56fd\u961f400\u7c73\u63a5\u529b\u83b7\u5f97\u94f6\u724c\u3002<\/p>\n<p><script>var funImgVt = function(input) { var imgvt = document.getElementById(\"imgVt\");if(imgvt) { imgvt.style.verticalAlign=input.value; } };<\/script><\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u5305\u542b\u811a\u672c\u884c\u4e3a\u548c\u6837\u5f0f\u63a7\u5236\uff0c\u4f1a\u7ecf\u5e38\u66f4\u65b0\u77e5\u8bc6\u70b9\u4ee5\u53ca\u4fee\u6b63\u4e00\u4e9b\u9519\u8bef\uff0c\u56e0\u6b64\u8f6c\u8f7d\u8bf7\u4fdd\u7559\u539f\u51fa\u5904\uff0c\u65b9\u4fbf\u6eaf\u6e90\uff0c\u907f\u514d\u9648\u65e7\u9519\u8bef\u77e5\u8bc6\u7684\u8bef\u5bfc\uff0c\u540c\u65f6\u6709\u66f4\u597d\u7684\u9605\u8bfb\u4f53\u9a8c\u3002<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=4925\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=4925<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=4925\" title=\"\u70b9\u51fb\u67e5\u770b\u672c\u6587\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201508\/covers-line-height-vertical-align.jpg\" width=\"550\" height=\"170\" class=\"imgpad mb10\" alt=\"CSS\u6df1\u5165\u7406\u89e3vertical-align\u548cline-height\u7684\u57fa\u53cb\u5173\u7cfb\"><\/a><br \/>\n\u672c\u6587\u6df1\u5165\u63a2\u8ba8vertical-align\u548cline-height\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u5c5e\u4e8e\u4e2d\u957f\u7bc7\uff0c\u6709\u5f88\u591a\u5176\u4ed6\u5730\u65b9\u770b\u4e0d\u5230\u7684\u77e5\u8bc6\u70b9\u3002\u5b9e\u4f8b\u6548\u679c\u5c31\u5728\u6587\u7ae0\u9875\u9762\u4e0a\uff0c\u56e0\u6b64\uff0c\u8bf7\u4f7f\u7528\u5408\u9002\u7684\u6d4f\u89c8\u5668\u67e5\u770b\u672c\u6587\u3002\u622a\u56fe\u4e30\u5bcc\uff0c\u6e90\u4ee3\u7801\u5c55\u793a\u8be6\u5c3d\uff0c\u76f8\u4fe1\u672c\u6587\u7684\u5185\u5bb9\u4f1a\u5bf9\u60a8\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\u7684\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1002,578,240,238,579,40,580,1016,1017],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/4925"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=4925"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/4925\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=4925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=4925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=4925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}