{"id":1347,"date":"2026-06-26T13:43:36","date_gmt":"2026-06-26T13:43:36","guid":{"rendered":"https:\/\/aabbee.cafe24.com\/?p=1347"},"modified":"2026-06-26T13:43:36","modified_gmt":"2026-06-26T13:43:36","slug":"layout","status":"publish","type":"post","link":"https:\/\/coalacoding.com\/layout\/","title":{"rendered":"\ub808\uc774\uc544\uc6c3\uacfc \uad6c\uc870"},"content":{"rendered":"<h1>2\uc7a5: \ub808\uc774\uc544\uc6c3\uacfc \uad6c\uc870<\/h1>\n<h2>v4 \uc124\uce58 \ubc0f \uae30\ubcf8 \uc124\uc815<\/h2>\n<blockquote>\n<p><strong>v4 \ubcc0\uacbd\uc0ac\ud56d<\/strong> \u2014 <code>tailwind.config.js<\/code> + <code>@tailwind<\/code> \uc9c0\uc2dc\uc5b4 \ubc29\uc2dd\uc774 <strong>CSS \uae30\ubc18 \uc124\uc815<\/strong>\uc73c\ub85c \uc804\ud658\ub410\ub2e4.<\/p>\n<\/blockquote>\n<pre><code class=\"language-bash\"># Vite \uae30\ubc18 \ud504\ub85c\uc81d\ud2b8 (\uad8c\uc7a5)\nnpm install tailwindcss @tailwindcss\/vite\n<\/code><\/pre>\n<pre><code class=\"language-js\">\/\/ vite.config.js\nimport { defineConfig } from &#39;vite&#39;\nimport tailwindcss from &#39;@tailwindcss\/vite&#39;\n\nexport default defineConfig({\n  plugins: [tailwindcss()],\n})\n<\/code><\/pre>\n<pre><code class=\"language-css\">\/* src\/index.css \u2014 \ub2e8 \ud55c \uc904\ub85c \uc804\uccb4 \uc784\ud3ec\ud2b8 *\/\n@import &quot;tailwindcss&quot;;\n<\/code><\/pre>\n<p>v3\uc5d0\uc11c \uc4f0\ub358 <code>@tailwind base; @tailwind components; @tailwind utilities;<\/code> \uc138 \uc904\uc740 \ub354 \uc774\uc0c1 \ud544\uc694 \uc5c6\ub2e4.<\/p>\n<hr>\n<h2>2-1. Flexbox\ub85c \ub808\uc774\uc544\uc6c3 \uad6c\ucd95\ud558\uae30<\/h2>\n<p>Flexbox\ub294 1\ucc28\uc6d0 \ub808\uc774\uc544\uc6c3(\uac00\ub85c \ub610\ub294 \uc138\ub85c \ud55c \ubc29\ud5a5)\uc744 \ub2e4\ub8e8\ub294 CSS \ubaa8\ub378\uc774\ub2e4.<br \/>\nTailwind v4\uc5d0\uc11c Flexbox \uc720\ud2f8\ub9ac\ud2f0 \uc790\uccb4\ub294 v3\uc640 \uac70\uc758 \ub3d9\uc77c\ud558\uc9c0\ub9cc, \uc0c8\ub85c\uc6b4 <strong>\ub17c\ub9ac \uc18d\uc131(logical properties)<\/strong> \uc720\ud2f8\ub9ac\ud2f0\uac00 \ucd94\uac00\ub410\ub2e4.<\/p>\n<h3>\ud50c\ub809\uc2a4 \ucee8\ud14c\uc774\ub108 \ud65c\uc131\ud654<\/h3>\n<pre><code class=\"language-html\">\n&lt;div class=&quot;flex&quot;&gt;...&lt;\/div&gt;\n\n\n&lt;div class=&quot;inline-flex&quot;&gt;...&lt;\/div&gt;\n<\/code><\/pre>\n<h3>\ud50c\ub809\uc2a4 \ubc29\ud5a5 (flex-direction)<\/h3>\n<table>\n<thead>\n<tr>\n<th>\ud074\ub798\uc2a4<\/th>\n<th>CSS \uac12<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>flex-row<\/code><\/td>\n<td><code>flex-direction: row<\/code> (\uae30\ubcf8)<\/td>\n<\/tr>\n<tr>\n<td><code>flex-row-reverse<\/code><\/td>\n<td><code>flex-direction: row-reverse<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>flex-col<\/code><\/td>\n<td><code>flex-direction: column<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>flex-col-reverse<\/code><\/td>\n<td><code>flex-direction: column-reverse<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-html\">\n&lt;div class=&quot;flex flex-row gap-4&quot;&gt;\n  &lt;div&gt;A&lt;\/div&gt;\n  &lt;div&gt;B&lt;\/div&gt;\n  &lt;div&gt;C&lt;\/div&gt;\n&lt;\/div&gt;\n\n\n&lt;div class=&quot;flex flex-col gap-4&quot;&gt;\n  &lt;div&gt;A&lt;\/div&gt;\n  &lt;div&gt;B&lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<h3>\ud50c\ub809\uc2a4 \uc904\ubc14\uafc8 (flex-wrap)<\/h3>\n<pre><code class=\"language-html\">\n&lt;div class=&quot;flex flex-wrap gap-2&quot;&gt;\n  &lt;div class=&quot;w-32&quot;&gt;item 1&lt;\/div&gt;\n  &lt;div class=&quot;w-32&quot;&gt;item 2&lt;\/div&gt;\n  &lt;div class=&quot;w-32&quot;&gt;item 3&lt;\/div&gt;\n&lt;\/div&gt;\n\n\n&lt;div class=&quot;flex flex-nowrap&quot;&gt;...&lt;\/div&gt;\n<\/code><\/pre>\n<h3>\uc8fc\ucd95 \uc815\ub82c (justify-content)<\/h3>\n<table>\n<thead>\n<tr>\n<th>\ud074\ub798\uc2a4<\/th>\n<th>\uc815\ub82c \ubc29\uc2dd<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>justify-start<\/code><\/td>\n<td>\uc2dc\uc791\uc810<\/td>\n<\/tr>\n<tr>\n<td><code>justify-end<\/code><\/td>\n<td>\ub05d\uc810<\/td>\n<\/tr>\n<tr>\n<td><code>justify-center<\/code><\/td>\n<td>\uc911\uc559<\/td>\n<\/tr>\n<tr>\n<td><code>justify-between<\/code><\/td>\n<td>\uc591 \ub05d \ubd84\uc0b0, \uc544\uc774\ud15c \uc0ac\uc774 \uacf5\uac04<\/td>\n<\/tr>\n<tr>\n<td><code>justify-around<\/code><\/td>\n<td>\uc544\uc774\ud15c \uc591\uce21 \ub3d9\uc77c \uacf5\uac04<\/td>\n<\/tr>\n<tr>\n<td><code>justify-evenly<\/code><\/td>\n<td>\ubaa8\ub4e0 \uacf5\uac04 \uade0\ub4f1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-html\">\n&lt;nav class=&quot;flex justify-between items-center px-6 py-4&quot;&gt;\n  &lt;span class=&quot;font-bold&quot;&gt;Logo&lt;\/span&gt;\n  &lt;ul class=&quot;flex gap-6&quot;&gt;\n    &lt;li&gt;Home&lt;\/li&gt;\n    &lt;li&gt;About&lt;\/li&gt;\n    &lt;li&gt;Contact&lt;\/li&gt;\n  &lt;\/ul&gt;\n&lt;\/nav&gt;\n<\/code><\/pre>\n<h3>\uad50\ucc28\ucd95 \uc815\ub82c (align-items)<\/h3>\n<table>\n<thead>\n<tr>\n<th>\ud074\ub798\uc2a4<\/th>\n<th>CSS \uac12<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>items-start<\/code><\/td>\n<td><code>align-items: flex-start<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>items-end<\/code><\/td>\n<td><code>align-items: flex-end<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>items-center<\/code><\/td>\n<td><code>align-items: center<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>items-baseline<\/code><\/td>\n<td><code>align-items: baseline<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>items-stretch<\/code><\/td>\n<td><code>align-items: stretch<\/code> (\uae30\ubcf8)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-html\">\n&lt;div class=&quot;flex items-center gap-2&quot;&gt;\n  &lt;svg class=&quot;size-5&quot;&gt;...&lt;\/svg&gt;\n  &lt;span&gt;\ud14d\uc2a4\ud2b8&lt;\/span&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<blockquote>\n<p><strong>v4 \uc2e0\uaddc<\/strong> \u2014 <code>size-5<\/code> \ub294 <code>w-5 h-5<\/code> \ub97c \ub3d9\uc2dc\uc5d0 \uc801\uc6a9\ud558\ub294 \ucd95\uc57d \uc720\ud2f8\ub9ac\ud2f0\ub2e4. v4\uc5d0\uc11c \ucd94\uac00\ub410\ub2e4.<\/p>\n<\/blockquote>\n<h3>\uac1c\ubcc4 \uc544\uc774\ud15c \uc815\ub82c (align-self)<\/h3>\n<pre><code class=\"language-html\">&lt;div class=&quot;flex items-start h-32&quot;&gt;\n  &lt;div&gt;\uae30\ubcf8(start)&lt;\/div&gt;\n  &lt;div class=&quot;self-center&quot;&gt;\ub098\ub9cc \uac00\uc6b4\ub370&lt;\/div&gt;\n  &lt;div class=&quot;self-end&quot;&gt;\ub098\ub9cc \ub05d&lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<h3>\ud50c\ub809\uc2a4 \ud655\uc7a5\u00b7\ucd95\uc18c<\/h3>\n<pre><code class=\"language-html\">\n&lt;div class=&quot;flex&quot;&gt;\n  &lt;div class=&quot;w-32&quot;&gt;\uace0\uc815&lt;\/div&gt;\n  &lt;div class=&quot;flex-1&quot;&gt;\ub098\uba38\uc9c0 \uacf5\uac04 \uc804\ubd80&lt;\/div&gt;\n  &lt;div class=&quot;w-32&quot;&gt;\uace0\uc815&lt;\/div&gt;\n&lt;\/div&gt;\n\n\n&lt;div class=&quot;flex&quot;&gt;\n  &lt;div class=&quot;grow&quot;&gt;\ud655\uc7a5\ub428&lt;\/div&gt;\n  &lt;div class=&quot;shrink-0&quot;&gt;\ucd95\uc18c \uc548 \ub428&lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<h3>\uc2e4\uc804 \ud328\ud134<\/h3>\n<p><strong>\uce74\ub4dc \uadf8\ub9ac\ub4dc (Flex wrap)<\/strong><\/p>\n<pre><code class=\"language-html\">&lt;div class=&quot;flex flex-wrap gap-4&quot;&gt;\n  &lt;div class=&quot;w-64 rounded-xl bg-white shadow p-4&quot;&gt;\uce74\ub4dc 1&lt;\/div&gt;\n  &lt;div class=&quot;w-64 rounded-xl bg-white shadow p-4&quot;&gt;\uce74\ub4dc 2&lt;\/div&gt;\n  &lt;div class=&quot;w-64 rounded-xl bg-white shadow p-4&quot;&gt;\uce74\ub4dc 3&lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<p><strong>\ud654\uba74 \uc804\uccb4 \ub192\uc774 \ub808\uc774\uc544\uc6c3 (sticky footer)<\/strong><\/p>\n<pre><code class=\"language-html\">&lt;div class=&quot;flex flex-col min-h-screen&quot;&gt;\n  &lt;header class=&quot;bg-gray-900 text-white p-4&quot;&gt;\ud5e4\ub354&lt;\/header&gt;\n  &lt;main class=&quot;flex-1 p-6&quot;&gt;\ucee8\ud150\uce20&lt;\/main&gt;\n  &lt;footer class=&quot;bg-gray-100 p-4 text-center&quot;&gt;\ud478\ud130&lt;\/footer&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<p><strong>\uc218\ud3c9\u00b7\uc218\uc9c1 \uc911\uc559 \uc815\ub82c<\/strong><\/p>\n<pre><code class=\"language-html\">&lt;div class=&quot;flex items-center justify-center min-h-screen&quot;&gt;\n  &lt;div class=&quot;bg-white rounded-2xl shadow-xl p-8&quot;&gt;\n    \uac00\uc6b4\ub370 \uc815\ub82c\ub41c \uce74\ub4dc\n  &lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<hr>\n<h2>2-2. Grid \uc2dc\uc2a4\ud15c<\/h2>\n<p>CSS Grid\ub294 2\ucc28\uc6d0 \ub808\uc774\uc544\uc6c3(\uac00\ub85c + \uc138\ub85c \ub3d9\uc2dc)\uc744 \ub2e4\ub8ec\ub2e4.<br \/>\nTailwind v4\uc5d0\uc11c Grid \uc720\ud2f8\ub9ac\ud2f0\ub294 v3\uc640 \ub3d9\uc77c\ud558\uace0, <strong>\uc784\uc758 \uac12(arbitrary value)<\/strong> \uc9c0\uc6d0\uc774 \ub354 \uc790\uc5f0\uc2a4\ub7ec\uc6cc\uc84c\ub2e4.<\/p>\n<h3>\uae30\ubcf8 \uadf8\ub9ac\ub4dc<\/h3>\n<pre><code class=\"language-html\">\n&lt;div class=&quot;grid grid-cols-3 gap-4&quot;&gt;\n  &lt;div&gt;1&lt;\/div&gt;\n  &lt;div&gt;2&lt;\/div&gt;\n  &lt;div&gt;3&lt;\/div&gt;\n  &lt;div&gt;4&lt;\/div&gt;\n  &lt;div&gt;5&lt;\/div&gt;\n  &lt;div&gt;6&lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<h3>\uc5f4\u00b7\ud589 \ubcd1\ud569 (span)<\/h3>\n<pre><code class=\"language-html\">&lt;div class=&quot;grid grid-cols-4 gap-4&quot;&gt;\n  \n  &lt;div class=&quot;col-span-2 bg-blue-100&quot;&gt;\ub113\uc740 \uc544\uc774\ud15c&lt;\/div&gt;\n  &lt;div&gt;\ubcf4\ud1b5&lt;\/div&gt;\n  &lt;div&gt;\ubcf4\ud1b5&lt;\/div&gt;\n\n  \n  &lt;div class=&quot;col-start-2 col-end-4&quot;&gt;2\uc5f4\uc5d0\uc11c 4\uc5f4\uae4c\uc9c0&lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<h3>\ud589 \uc81c\uc5b4<\/h3>\n<pre><code class=\"language-html\">&lt;div class=&quot;grid grid-rows-3 grid-flow-col gap-4 h-48&quot;&gt;\n  &lt;div&gt;A&lt;\/div&gt;\n  &lt;div&gt;B&lt;\/div&gt;\n  &lt;div&gt;C&lt;\/div&gt;\n  &lt;div&gt;D&lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<h3>\ubc18\uc751\ud615 \uadf8\ub9ac\ub4dc<\/h3>\n<pre><code class=\"language-html\">\n&lt;div class=&quot;grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6&quot;&gt;\n  &lt;div class=&quot;bg-white rounded-xl shadow p-4&quot;&gt;\uce74\ub4dc A&lt;\/div&gt;\n  &lt;div class=&quot;bg-white rounded-xl shadow p-4&quot;&gt;\uce74\ub4dc B&lt;\/div&gt;\n  &lt;div class=&quot;bg-white rounded-xl shadow p-4&quot;&gt;\uce74\ub4dc C&lt;\/div&gt;\n  &lt;div class=&quot;bg-white rounded-xl shadow p-4&quot;&gt;\uce74\ub4dc D&lt;\/div&gt;\n  &lt;div class=&quot;bg-white rounded-xl shadow p-4&quot;&gt;\uce74\ub4dc E&lt;\/div&gt;\n  &lt;div class=&quot;bg-white rounded-xl shadow p-4&quot;&gt;\uce74\ub4dc F&lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<h3>auto-fit \/ auto-fill (\uc784\uc758 \uac12)<\/h3>\n<p><code>grid-cols-[repeat(auto-fit,minmax(200px,1fr))]<\/code> \ud328\ud134\uc73c\ub85c \uc5f4 \uc218\ub97c \uc790\ub3d9 \uacc4\uc0b0\ud560 \uc218 \uc788\ub2e4.<\/p>\n<pre><code class=\"language-html\">\n&lt;div class=&quot;grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] gap-4&quot;&gt;\n  &lt;div class=&quot;bg-slate-100 p-4 rounded&quot;&gt;\uc544\uc774\ud15c&lt;\/div&gt;\n  &lt;div class=&quot;bg-slate-100 p-4 rounded&quot;&gt;\uc544\uc774\ud15c&lt;\/div&gt;\n  &lt;div class=&quot;bg-slate-100 p-4 rounded&quot;&gt;\uc544\uc774\ud15c&lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<h3>\ubcf5\uc7a1\ud55c \ub808\uc774\uc544\uc6c3 (named areas)<\/h3>\n<pre><code class=\"language-html\">\n&lt;div class=&quot;grid gap-4\n  [grid-template-areas:&#39;header_header&#39;&#39;sidebar_main&#39;&#39;footer_footer&#39;]\n  grid-cols-[200px_1fr]&quot;&gt;\n  &lt;header class=&quot;[grid-area:header] bg-gray-800 text-white p-4&quot;&gt;\ud5e4\ub354&lt;\/header&gt;\n  &lt;aside class=&quot;[grid-area:sidebar] bg-gray-100 p-4&quot;&gt;\uc0ac\uc774\ub4dc\ubc14&lt;\/aside&gt;\n  &lt;main class=&quot;[grid-area:main] p-4&quot;&gt;\uba54\uc778 \ucf58\ud150\uce20&lt;\/main&gt;\n  &lt;footer class=&quot;[grid-area:footer] bg-gray-200 p-4&quot;&gt;\ud478\ud130&lt;\/footer&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<hr>\n<h2>2-3. \uac04\uaca9\uacfc \uc815\ub82c<\/h2>\n<h3>\uc5ec\ubc31(margin)\uacfc \ud328\ub529(padding)<\/h3>\n<p>\ud328\ud134: <code>{\uc18d\uc131}{\ubc29\ud5a5}-{\ud06c\uae30}<\/code><\/p>\n<table>\n<thead>\n<tr>\n<th>\uc18d\uc131<\/th>\n<th>\ubc29\ud5a5<\/th>\n<th>\uc608\uc2dc<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>m<\/code> (margin)<\/td>\n<td>\uc5c6\uc74c(\uc804\uccb4), <code>t<\/code> <code>r<\/code> <code>b<\/code> <code>l<\/code> <code>x<\/code> <code>y<\/code><\/td>\n<td><code>m-4<\/code>, <code>mt-2<\/code>, <code>mx-auto<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>p<\/code> (padding)<\/td>\n<td>\uc5c6\uc74c(\uc804\uccb4), <code>t<\/code> <code>r<\/code> <code>b<\/code> <code>l<\/code> <code>x<\/code> <code>y<\/code><\/td>\n<td><code>p-6<\/code>, <code>py-3<\/code>, <code>px-4<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\ud06c\uae30 \ucc99\ub3c4: \uae30\ubcf8 \ub2e8\uc704\ub294 <code>0.25rem<\/code> (= 4px). <code>4<\/code> = <code>1rem<\/code> = <code>16px<\/code>.<\/p>\n<pre><code class=\"language-html\">\n&lt;div class=&quot;p-6 m-4 rounded-2xl shadow-md bg-white&quot;&gt;\n  &lt;h2 class=&quot;mb-2 text-xl font-bold&quot;&gt;\uc81c\ubaa9&lt;\/h2&gt;\n  &lt;p class=&quot;mb-4 text-gray-600&quot;&gt;\uc124\uba85 \ud14d\uc2a4\ud2b8&lt;\/p&gt;\n  &lt;button class=&quot;px-4 py-2 bg-blue-500 text-white rounded-lg&quot;&gt;\n    \ubc84\ud2bc\n  &lt;\/button&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<blockquote>\n<p><strong>v4 \uc2e0\uaddc<\/strong> \u2014 \ub17c\ub9ac \uc18d\uc131 \uc720\ud2f8\ub9ac\ud2f0\uac00 \ucd94\uac00\ub410\ub2e4. <code>ms-*<\/code> (margin-inline-start), <code>me-*<\/code> (margin-inline-end), <code>ps-*<\/code>, <code>pe-*<\/code> \u2014 RTL \ub808\uc774\uc544\uc6c3 \uc9c0\uc6d0\uc5d0 \ud65c\uc6a9\ud55c\ub2e4.<\/p>\n<\/blockquote>\n<pre><code class=\"language-html\">\n&lt;div dir=&quot;rtl&quot;&gt;\n  &lt;div class=&quot;ms-4&quot;&gt;&lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<h3>\uc790\uc2dd \uc694\uc18c \uac04 \uac04\uaca9 (space-between)<\/h3>\n<p><code>space-x-*<\/code>, <code>space-y-*<\/code> \ub294 \uc790\uc2dd \uc694\uc18c \uc0ac\uc774\uc5d0 margin\uc744 \ucd94\uac00\ud55c\ub2e4.<\/p>\n<pre><code class=\"language-html\">\n&lt;ul class=&quot;space-y-2&quot;&gt;\n  &lt;li class=&quot;bg-gray-50 p-3 rounded&quot;&gt;\ud56d\ubaa9 1&lt;\/li&gt;\n  &lt;li class=&quot;bg-gray-50 p-3 rounded&quot;&gt;\ud56d\ubaa9 2&lt;\/li&gt;\n  &lt;li class=&quot;bg-gray-50 p-3 rounded&quot;&gt;\ud56d\ubaa9 3&lt;\/li&gt;\n&lt;\/ul&gt;\n<\/code><\/pre>\n<blockquote>\n<p><strong>gap vs space<\/strong>: Grid\u00b7Flex \ucee8\ud14c\uc774\ub108\uc5d0\uc11c\ub294 <code>gap-*<\/code> \uc0ac\uc6a9\uc744 \uad8c\uc7a5\ud55c\ub2e4. <code>space-*<\/code>\ub294 \ub2e8\uc21c \ube14\ub85d \uc694\uc18c\uc5d0 \uc720\uc6a9\ud558\ub2e4.<\/p>\n<\/blockquote>\n<h3>\ud14d\uc2a4\ud2b8 \uc815\ub82c<\/h3>\n<pre><code class=\"language-html\">&lt;p class=&quot;text-left&quot;&gt;\uc67c\ucabd \uc815\ub82c&lt;\/p&gt;\n&lt;p class=&quot;text-center&quot;&gt;\uac00\uc6b4\ub370 \uc815\ub82c&lt;\/p&gt;\n&lt;p class=&quot;text-right&quot;&gt;\uc624\ub978\ucabd \uc815\ub82c&lt;\/p&gt;\n&lt;p class=&quot;text-justify&quot;&gt;\uc591\ucabd \uc815\ub82c&lt;\/p&gt;\n<\/code><\/pre>\n<h3>\uc704\uce58(position)\uc640 z-index<\/h3>\n<pre><code class=\"language-html\">\n&lt;div class=&quot;relative w-16 h-16&quot;&gt;\n  &lt;img src=&quot;...&quot; class=&quot;rounded-full size-16&quot; alt=&quot;avatar&quot; \/&gt;\n  &lt;span class=&quot;absolute -top-1 -right-1 size-5 bg-green-400 rounded-full border-2 border-white&quot;&gt;&lt;\/span&gt;\n&lt;\/div&gt;\n\n\n&lt;header class=&quot;fixed top-0 left-0 right-0 z-50 bg-white shadow&quot;&gt;\n  ...\n&lt;\/header&gt;\n\n\n&lt;aside class=&quot;sticky top-4 h-fit&quot;&gt;...&lt;\/aside&gt;\n<\/code><\/pre>\n<h3>\uc624\ubc84\ud50c\ub85c\uc6b0<\/h3>\n<pre><code class=\"language-html\">\n&lt;ul class=&quot;h-64 overflow-y-auto border rounded&quot;&gt;\n  &lt;li class=&quot;p-2&quot;&gt;\ud56d\ubaa9...&lt;\/li&gt;\n&lt;\/ul&gt;\n\n\n&lt;p class=&quot;overflow-hidden text-ellipsis whitespace-nowrap max-w-xs&quot;&gt;\n  \uc544\uc8fc \uae34 \ud14d\uc2a4\ud2b8\uac00 \uc5ec\uae30\uc5d0 \ub4e4\uc5b4\uac11\ub2c8\ub2e4...\n&lt;\/p&gt;\n<\/code><\/pre>\n<hr>\n<h2>2-4. v4 \ub808\uc774\uc544\uc6c3 \uad00\ub828 \uc2e0\uaddc \uc720\ud2f8\ub9ac\ud2f0<\/h2>\n<h3>size-* (width + height \ub3d9\uc2dc \uc124\uc815)<\/h3>\n<pre><code class=\"language-html\">\n\n&lt;div class=&quot;size-10 bg-blue-500 rounded-full&quot;&gt;&lt;\/div&gt;\n&lt;img class=&quot;size-16 rounded-full object-cover&quot; src=&quot;...&quot; alt=&quot;...&quot; \/&gt;\n<\/code><\/pre>\n<h3>inset-* (top\/right\/bottom\/left \ub3d9\uc2dc \uc124\uc815)<\/h3>\n<pre><code class=\"language-html\">\n&lt;div class=&quot;fixed inset-0 bg-black\/50&quot;&gt;&lt;\/div&gt;\n\n\n&lt;div class=&quot;absolute inset-x-0 bottom-0&quot;&gt;\ud558\ub2e8 \uc804\uccb4 \ub108\ube44 \ubc14&lt;\/div&gt;\n<\/code><\/pre>\n<h3>field-sizing (v4 \uc2e0\uaddc)<\/h3>\n<p>\ud14d\uc2a4\ud2b8 \uc785\ub825\ucc3d\uc774 \ub0b4\uc6a9\uc5d0 \ub530\ub77c \uc790\ub3d9 \ud06c\uae30 \uc870\uc808\ub41c\ub2e4.<\/p>\n<pre><code class=\"language-html\">&lt;textarea class=&quot;field-sizing-content border rounded p-2 resize-none&quot;&gt;\n  \ub0b4\uc6a9\uc5d0 \ub9de\uac8c \ub192\uc774 \uc790\ub3d9 \uc870\uc808\n&lt;\/textarea&gt;\n<\/code><\/pre>\n<hr>\n<h2>2-5. v4 \ucee4\uc2a4\ud140 \uc2a4\ud398\uc774\uc2f1<\/h2>\n<p>v3\uc5d0\uc11c\ub294 <code>tailwind.config.js<\/code>\uc5d0\uc11c \uc124\uc815\ud588\ub2e4. v4\uc5d0\uc11c\ub294 CSS \ud30c\uc77c \ub0b4 <code>@theme<\/code>\uc73c\ub85c \ucc98\ub9ac\ud55c\ub2e4.<\/p>\n<pre><code class=\"language-css\">\/* src\/index.css *\/\n@import &quot;tailwindcss&quot;;\n\n@theme {\n  --spacing-18: 4.5rem;   \/* p-18, m-18, w-18 \ub4f1 \uc790\ub3d9 \uc0dd\uc131 *\/\n  --spacing-88: 22rem;\n  --spacing-128: 32rem;\n}\n<\/code><\/pre>\n<pre><code class=\"language-html\">\n&lt;div class=&quot;p-18 w-128&quot;&gt;...&lt;\/div&gt;\n<\/code><\/pre>\n<hr>\n<blockquote>\n<p><strong>\ud575\uc2ec \uc815\ub9ac<\/strong><\/p>\n<ul>\n<li>Flex: 1\ucc28\uc6d0(\uac00\ub85c or \uc138\ub85c), <code>flex \u2192 flex-row\/col \u2192 justify\/items\/gap<\/code><\/li>\n<li>Grid: 2\ucc28\uc6d0, <code>grid \u2192 grid-cols-N \u2192 col-span-N \u2192 gap<\/code><\/li>\n<li>\uac04\uaca9: <code>p-*<\/code>(\ub0b4\ubd80), <code>m-*<\/code>(\uc678\ubd80), <code>gap-*<\/code>(\uc790\uc2dd \uc0ac\uc774)<\/li>\n<li>v4 \uc2e0\uaddc: <code>size-*<\/code>, \ub17c\ub9ac \uc18d\uc131(<code>ms-*<\/code>, <code>me-*<\/code>), <code>field-sizing<\/code><\/li>\n<li>v4 \uc124\uc815: <code>tailwind.config.js<\/code> \u2192 CSS \ub0b4 <code>@theme<\/code><\/li>\n<\/ul>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>2\uc7a5: \ub808\uc774\uc544\uc6c3\uacfc \uad6c\uc870 v4 \uc124\uce58 \ubc0f \uae30\ubcf8 \uc124\uc815 v4 \ubcc0\uacbd\uc0ac\ud56d \u2014 tailwind.config.js + @tailwind \uc9c0\uc2dc\uc5b4 \ubc29\uc2dd\uc774 CSS \uae30\ubc18 \uc124\uc815\uc73c\ub85c \uc804\ud658\ub410\ub2e4. # Vite \uae30\ubc18 \ud504\ub85c\uc81d\ud2b8 (\uad8c\uc7a5) npm install tailwindcss @tailwindcss\/vite \/\/ vite.config.js import { defineConfig } from &#39;vite&#39; import tailwindcss from &#39;@tailwindcss\/vite&#39; export default defineConfig({ plugins: [tailwindcss()], }) \/* src\/index.css \u2014 \ub2e8 \ud55c \uc904\ub85c \uc804\uccb4 \uc784\ud3ec\ud2b8 &#8230; <a title=\"\ub808\uc774\uc544\uc6c3\uacfc \uad6c\uc870\" class=\"read-more\" href=\"https:\/\/coalacoding.com\/layout\/\" aria-label=\"\ub808\uc774\uc544\uc6c3\uacfc \uad6c\uc870\uc5d0 \ub300\ud574 \ub354 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uc138\uc694\">\ub354 \uc77d\uae30<\/a><\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-1347","post","type-post","status-publish","format-standard","hentry","category-html-css-tailwind"],"_links":{"self":[{"href":"https:\/\/coalacoding.com\/wp-json\/wp\/v2\/posts\/1347","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coalacoding.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coalacoding.com\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/coalacoding.com\/wp-json\/wp\/v2\/comments?post=1347"}],"version-history":[{"count":0,"href":"https:\/\/coalacoding.com\/wp-json\/wp\/v2\/posts\/1347\/revisions"}],"wp:attachment":[{"href":"https:\/\/coalacoding.com\/wp-json\/wp\/v2\/media?parent=1347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coalacoding.com\/wp-json\/wp\/v2\/categories?post=1347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coalacoding.com\/wp-json\/wp\/v2\/tags?post=1347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}