ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

ํ‘ธํ„ฐ์˜ ์œ„์น˜๋ฅผ ์›ํ•˜๋Š”๋Œ€๋กœ ๋ฐฐ์น˜ํ•ด๋ณด์ž.

 

์ฑ”ํ”ผ์–ธ ๋ชฉ๋ก์ฒ˜๋Ÿผ ๋ฐ์ดํ„ฐ๊ฐ€ ๋งŽ์•„์„œ ์Šคํฌ๋กค์ด ์ƒ๊ธธ ๊ฒฝ์šฐ ํ‘ธํ„ฐ๊ฐ€ ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ์•„๋ž˜๋กœ ๊ฐ€๊ฒŒ ๋˜๋Š”๋ฐ, ์ฑ”ํ”ผ์–ธ ์ƒ์„ธ ํ™”๋ฉด์—์„œ ์Šคํฌ๋กค์ด ์ƒ๊ธธ ์ •๋„๋กœ ๋ฐ์ดํ„ฐ๊ฐ€ ๋งŽ์ง€ ์•Š์œผ๋ฉด ํ‘ธํ„ฐ๊ฐ€ ์ค‘์•™์— ์ž๋ฆฌ ์žก๊ณ  ์žˆ๋Š” ํ˜„์ƒ์ด ๋ฐœ์ƒํ–ˆ๋‹ค. ๐Ÿ˜ฎ‍๐Ÿ’จ

 

๋ฌธ์ œ์ 

๋ชฉ๋ก์€ ํ‘ธํ„ฐ๊ฐ€ ๋‚ด๊ฐ€ ์›ํ•˜๋Š” ๋Œ€๋กœ ์•Œ์•„์„œ ์•„๋ž˜์— ์ž˜ ์ž๋ฆฌ ์žก๊ณ  ์žˆ๋‹ค.

 

๊ทธ๋Ÿฌ๋‚˜. . ์ฑ”ํ”ผ์–ธ ์ƒ์„ธ ํŽ˜์ด์ง€์—์„œ๋Š”...

๋ฐ์ดํ„ฐ์˜ ์–‘์ด ์ ๊ธฐ ๋•Œ๋ฌธ์— ์Šคํฌ๋กค์ด ์ƒ๊ธฐ์ง€ ์•Š๊ณ  ์• ๋งคํ•œ ์ค‘์•™์— ์œ„์น˜ํ•ด ์žˆ๋Š” ์ƒํƒœ๊ฐ€ ๋˜์—ˆ๋‹ค.

 

๋‚ด๊ฐ€ ์›ํ•˜๋˜ ๊ฒƒ์€.. ์Šคํฌ๋กค์ด ์ƒ๊ธฐ๋ฉด ์Šคํฌ๋กค์ด ๋๋‚˜๊ณ  ํ‘ธํ„ฐ๊ฐ€ ๋ณด์ด๊ณ , ๋ฐ์ดํ„ฐ๊ฐ€ ๋ณ„๋กœ ์—†์–ด์„œ ์Šคํฌ๋กค์ด ์ƒ๊ธฐ์ง€ ์•Š๋Š”๋‹ค๋ฉด ๋ทฐํฌ์ธํŠธ ํ•˜๋‹จ์— ํ‘ธ๋”๊ฐ€ ๋ณด์ด๋„๋ก ํ•˜๋Š” ๊ฒƒ์ด๋‹ค. ์ด๋ฅผ ํ•ด๊ฒฐํ•ด ๋ณด์ž.

 

๋ณ€๊ฒฝ ์ „ ์ฝ”๋“œ

<html lang="en">
  <body className="bg-black">
    <Providers>
      <header className="bg-gray-800 text-white py-4 fixed top-0 w-full z-10">
        <nav className="flex justify-around ">
          <Link href={"/"}>ํ™ˆ</Link>
          <Link href={"/champions"}>์ฑ”ํ”ผ์–ธ ๋ชฉ๋ก</Link>
          <Link href={"/items"}>์•„์ดํ…œ ๋ชฉ๋ก</Link>
          <Link href={"/rotation"}>์ฑ”ํ”ผ์–ธ ๋กœํ…Œ์ด์…˜</Link>
        </nav>
      </header>
      <main className="pt-28">{children}</main>
      <footer className="bg-gray-800 p-4 mt-8 ">
        <div className="text-center text-white text-sm">
          <p>jungminji</p>
        </div>
      </footer>
    </Providers>
  </body>
</html>

 

ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

<html lang="en">
  <body className="bg-black min-h-screen flex flex-col">
    <Providers>
      <header className="bg-gray-800 text-white py-4 fixed top-0 w-full z-10">
        <nav className="flex justify-around ">
          <Link href={"/"}>ํ™ˆ</Link>
          <Link href={"/champions"}>์ฑ”ํ”ผ์–ธ ๋ชฉ๋ก</Link>
          <Link href={"/items"}>์•„์ดํ…œ ๋ชฉ๋ก</Link>
          <Link href={"/rotation"}>์ฑ”ํ”ผ์–ธ ๋กœํ…Œ์ด์…˜</Link>
        </nav>
      </header>
      <main className="pt-28 grow">{children}</main>
      <footer className="bg-gray-800 p-4 mt-8 ">
        <div className="text-center text-white text-sm">
          <p>jungminji</p>
        </div>
      </footer>
    </Providers>
  </body>
</html>

 

<body className="bg-black min-h-screen">
  • min-h-screen : min-height: 100vh ์„ ์˜๋ฏธํ•œ๋‹ค. ์ด ์„ค์ •์œผ๋กœ ์ธํ•ด ํŽ˜์ด์ง€์˜ ๋†’์ด๊ฐ€ ์ ์–ด๋„ ํ™”๋ฉด์˜ ์ „์ฒด ๋†’์ด๋งŒํผ ์œ ์ง€๋œ๋‹ค. ํ•˜์ง€๋งŒ, ์ด ์„ค์ •๋งŒ์œผ๋กœ ํ‘ธํ„ฐ๊ฐ€ ์•„๋ž˜์— ์œ„์น˜ํ•˜์ง€ ์•Š๋Š”๋‹ค. body ์˜ ์ž์‹๋“ค์„ ์–ด๋–ค ์‹์œผ๋กœ ๋ฐฐ์น˜ํ• ์ง€ ์•„์ง ์ •ํ•ด์ง€์ง€ ์•Š์•˜๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค. ์ด ์ƒํƒœ์—์„œ๋Š” body ๊ฐ€ ๋ทฐํฌํŠธ ์ „์ฒด๋ฅผ ์ฐจ์ง€ํ•˜๊ณ  ์žˆ์ง€๋งŒ ์ž์‹๋“ค์€ ๊ทธ๋ƒฅ ์ƒ๊ฒจ๋‚œ ๋Œ€๋กœ ์•Œ์•„์„œ ์œ„์น˜ํ•ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์— main ์˜ ๋‚ด์šฉ๋ฌผ์ด ์ ์œผ๋ฉด ์Šคํฌ๋กค์ด ๋ฐœ์ƒํ•˜์ง€ ์•Š๊ณ  ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ํ‘ธํ„ฐ๋„ ํ•˜๋‹จ์ด ์•„๋‹Œ ์• ๋งคํ•œ ๊ณณ์— ์žˆ๊ฒŒ ๋œ๋‹ค.

 

<body className="bg-black min-h-screen flex flex-col">
  • body ์— flexbox ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ž์‹ ์š”์†Œ๋“ค์„ ์–ด๋–ป๊ฒŒ ๋ฐฐ์น˜ํ• ์ง€์— ๋Œ€ํ•œ ์ปจํŠธ๋กค์ด ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ–ˆ๋‹ค. 

 

<main className="pt-28 grow">{children}</main>
  • grow : flex-grow : 1 ์„ ๋ช…์‹œํ•ด์ฃผ๋ฉด body ์˜ flexbox ๋ ˆ์ด์•„์›ƒ ํšจ๊ณผ๊ฐ€ ๋ฐœ๋™ํ•˜๊ฒŒ ๋œ๋‹ค. flex-grow : 1 ์€ main ๋‚จ์€ ๊ณต๊ฐ„์„ ์ฐจ์ง€ํ•˜๋„๋ก ํ•  ์ˆ˜ ์žˆ๋‹ค. ํ•ด๋‹น ์†์„ฑ๊ฐ’ ๋•๋ถ„์— main ์ด body ์˜ ๋‚จ์€ ๋ชจ๋“  ๊ณต๊ฐ„์„ ์ฐจ์ง€ํ•˜๋ ค๊ณ  ์‹œ๋„ํ•˜๊ณ  ์ด๋•Œ header ์™€ footer ์€ ๊ฐ๊ฐ ๊ณ ์ •๋œ ๋†’์ด๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์œผ๋ฏ€๋กœ header ์™€ footer ๋ฅผ ์ œ์™ธํ•œ ๋‚จ์€ ๊ณต๊ฐ„์„ ์ „๋ถ€ main ์ด ์ฑ„์šฐ๊ฒŒ ๋œ๋‹ค. 

 

์œ„์™€ ๊ฐ™์€ ์Šคํƒ€์ผ์„ ์ ์šฉํ•ด ์ฃผ๋ฉด ๋‚ด๊ฐ€ ์›ํ•˜๋˜ ๋Œ€๋กœ ์š”์†Œ๋“ค์ด ์ด์˜๊ฒŒ ์œ„์น˜ํ•˜๊ฒŒ ๋˜์—ˆ๋‹ค!!

์ตœ๊ทผ์— ์˜ฌ๋ผ์˜จ ๊ธ€
Total
Today
Yesterday
๋งํฌ