{"id":27956,"date":"2024-11-24T08:43:04","date_gmt":"2024-11-24T00:43:04","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27956\/"},"modified":"2024-11-24T08:43:04","modified_gmt":"2024-11-24T00:43:04","slug":"tailwind-css-%e4%b8%ad%e7%9a%84-line-height-%e4%b8%ba%e4%bb%80%e4%b9%88%e5%a4%b1%e6%95%88%e4%ba%86%ef%bc%9f%e5%a6%82%e4%bd%95%e5%9e%82%e7%9b%b4%e5%b1%85%e4%b8%ad%e5%85%83%e7%b4%a0%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27956\/","title":{"rendered":"Tailwind CSS \u4e2d\u7684 line-height \u4e3a\u4ec0\u4e48\u5931\u6548\u4e86\uff1f\u5982\u4f55\u5782\u76f4\u5c45\u4e2d\u5143\u7d20\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173137069399498.jpg\" class=\"aligncenter\" title=\"Tailwind CSS \u4e2d\u7684 line-height \u4e3a\u4ec0\u4e48\u5931\u6548\u4e86\uff1f\u5982\u4f55\u5782\u76f4\u5c45\u4e2d\u5143\u7d20\uff1f\u63d2\u56fe\" alt=\"Tailwind CSS \u4e2d\u7684 line-height \u4e3a\u4ec0\u4e48\u5931\u6548\u4e86\uff1f\u5982\u4f55\u5782\u76f4\u5c45\u4e2d\u5143\u7d20\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>tlwind  \u4e2d\u7684 line-height \u672a\u751f\u6548\uff1f\u89e3\u51b3\u96be\u9898<\/strong><\/p>\n<p>\u4f7f\u7528 tailwind css \u65f6\uff0c\u4f60\u53ef\u80fd\u4f1a\u9047\u5230 line-height \u65e0\u6cd5\u6b63\u5e38\u5de5\u4f5c\u7684\u60c5\u51b5\uff0c\u5bfc\u81f4\u5782\u76f4\u5c45\u4e2d\u65e0\u6cd5\u6b63\u786e\u5b9e\u73b0\u3002\u4ee5\u4e0b\u95ee\u9898\u548c\u89e3\u7b54\u5c06\u5e2e\u52a9\u4f60\u7406\u89e3\u539f\u56e0\u5e76\u89e3\u51b3\u6b64\u95ee\u9898\uff1a<\/p>\n<p><strong>\u95ee\u9898\uff1a<\/strong><\/p>\n<\/p>\n<pre>&lt;nav class=\"w-full nav h-12\"&gt;&lt;\/p&gt;&lt;p&gt;&lt;span&gt;\u7acb\u5373\u5b66\u4e60&lt;\/span&gt;\u201c&lt;a href=\"https:\/\/pan.quark.cn\/s\/cb6835dc7db1\" style=\"text-decoration: underline !important; color: blue; font-weight: bolder;\" rel=\"nofollow\" target=\"_blank\"&gt;\u524d\u7aef\u514d\u8d39\u5b66\u4e60\u7b14\u8bb0\uff08\u6df1\u5165\uff09&lt;\/a&gt;\u201d\uff1b&lt;\/p&gt;&lt;pre class=\"brush:php;toolbar:false\"&gt;&lt;div class=\"container mx-auto flex\"&gt;\n    &lt;div class=\"w-24 leading-6 text-center h-12 hover:bg-black\"&gt;\u9996\u9875&lt;\/div&gt;\n    &lt;p class=\"w-24 leading-6 text-center h-12 hover:bg-black\"&gt;\u9996\u9875&lt;\/p&gt;\n    &lt;span class=\"w-24 leading-6 text-center h-12 hover:bg-black\"&gt;\u9996\u9875&lt;\/span&gt;\n&lt;\/div&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<\/p>\n<p>\u8fd9\u91cc\u7684 leading-6 \u5747\u672a\u751f\u6548\uff0c\u5782\u76f4\u5c45\u4e2d\u5982\u4f55\u5b9e\u73b0\uff1f<\/p>\n<p><strong>\u89e3\u7b54\uff1a<\/strong><\/p>\n<p>\u6b64\u95ee\u9898\u7684\u6839\u6e90\u5728\u4e8e h-12 \u7684\u5b9e\u9645\u503c\u662f height: 3rem;\uff0c\u800c leading-6 \u7684\u5b9e\u9645\u503c\u662f line-height:1.5rem\uff0c\u4e24\u8005\u5dee\u4e86\u4e00\u534a\uff0c\u5bfc\u81f4\u65e0\u6cd5\u5782\u76f4\u5c45\u4e2d\u3002<\/p>\n<p>\u53e6\u5916\uff0cleading-* \u7684\u6700\u5927\u503c\u53ea\u6709\u5230 leading-10\uff08\u5373 line-height: 2.5rem\uff09\uff0c\u6ca1\u6709 leading-12\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u60f3\u8981\u5782\u76f4\u5c45\u4e2d\uff0c\u53ef\u4ee5\u8fd9\u6837\u8bbe\u7f6e\u539f\u5b50\u7c7b\uff1a<\/p>\n<pre>&lt;nav class=\"nav h-12 w-full\"&gt;\n  &lt;div class=\"container mx-auto flex\"&gt;\n    &lt;div class=\"flex h-12 w-24 items-center justify-center hover:bg-black hover:text-white\"&gt;\u9996\u9875&lt;\/div&gt;\n    &lt;p class=\"flex h-12 w-24 items-center justify-center hover:bg-black hover:text-white\"&gt;\u9996\u9875&lt;\/p&gt;\n    &lt;span class=\"flex h-12 w-24 items-center justify-center hover:bg-black hover:text-white\"&gt;\u9996\u9875&lt;\/span&gt;\n  &lt;\/div&gt;\n&lt;\/nav&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6216\u8005\uff0c\u5982\u679c\u53ef\u4ee5\u7684\u8bdd\uff0c\u7f29\u5c0f\u9ad8\u5ea6\u503c\u4e3a h-10 \u4e5f\u53ef\u4ee5\uff1a<\/p>\n<pre>&lt;nav class=\"nav h-10 w-full\"&gt;\n  &lt;div class=\"container mx-auto flex\"&gt;\n    &lt;div class=\"h-10 w-24 text-center leading-10 hover:bg-black hover:text-white\"&gt;\u9996\u9875&lt;\/div&gt;\n    &lt;p class=\"h-10 w-24 text-center leading-10 hover:bg-black hover:text-white\"&gt;\u9996\u9875&lt;\/p&gt;\n    &lt;span class=\"h-10 w-24 text-center leading-10 hover:bg-black hover:text-white\"&gt;\u9996\u9875&lt;\/span&gt;\n  &lt;\/div&gt;\n&lt;\/nav&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5f53\u7136\uff0c\u4f60\u4e5f\u53ef\u4ee5\u81ea\u5df1\u5b9a\u4e49\u4e00\u4e2a leading-12 \u7c7b\u5e76\u4f7f\u7528\u5b83\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fTlwind CSS \u4e2d\u7684 line-height \u5931\u6548\u4e86\uff1f\u5982\u4f55\u5143\u7d20\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>tlwind \u4e2d\u7684 line-height \u672a\u751f\u6548\uff1f\u89e3\u51b3\u96be\u9898 \u4f7f\u7528 tailwind css \u65f6\uff0c\u4f60\u53ef\u80fd\u4f1a\u9047\u5230 line-height \u65e0\u6cd5\u6b63\u5e38\u5de5\u4f5c\u7684\u60c5\u51b5\uff0c\u5bfc\u81f4\u5782\u76f4\u5c45\u4e2d\u65e0\u6cd5\u6b63\u786e\u5b9e\u73b0\u3002\u4ee5\u4e0b\u95ee\u9898\u548c\u89e3\u7b54\u5c06\u5e2e\u52a9\u4f60\u7406\u89e3\u539f\u56e0\u5e76\u89e3\u51b3\u6b64\u95ee\u9898\uff1a \u95ee\u9898\uff1a &lt;nav class=&#8221;w-full nav h-12&#8243;&gt;&lt;\/p&gt;&lt;p&gt;&lt;span&gt;\u7acb\u5373\u5b66\u4e60&lt;\/span&gt;\u201c&lt;a href=&#8221;https:\/\/pan.quark.cn\/s\/cb6835dc7db1&#8243; style=&#8221;text-decoration: underline !important; color: blue; font-weight: bolder;&#8221; rel=&#8221;nofollow&#8221; target=&#8221;_blank&#8221;&gt;\u524d\u7aef\u514d\u8d39\u5b66\u4e60\u7b14\u8bb0\uff08\u6df1\u5165\uff09&lt;\/a&gt;\u201d\uff1b&lt;\/p&gt;&lt;pre class=&#8221;brush:php;toolbar:false&#8221;&gt;&lt;div class=&#8221;container mx-auto flex&#8221;&gt; &lt;div class=&#8221;w-24 leading-6 text-center h-12 hover:bg-black&#8221;&gt;\u9996\u9875&lt;\/div&gt; &lt;p class=&#8221;w-24 leading-6 text-center h-12 hover:bg-black&#8221;&gt;\u9996\u9875&lt;\/p&gt; &lt;span class=&#8221;w-24 leading-6 text-center h-12 hover:bg-black&#8221;&gt;\u9996\u9875&lt;\/span&gt; &lt;\/div&gt; \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u91cc\u7684 leading-6 \u5747\u672a\u751f\u6548\uff0c\u5782\u76f4\u5c45\u4e2d\u5982\u4f55\u5b9e\u73b0\uff1f \u89e3\u7b54\uff1a \u6b64\u95ee\u9898\u7684\u6839\u6e90\u5728\u4e8e h-12 [&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-27956","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27956","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=27956"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27956\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}