๐Ÿ’ช๐Ÿผํ™ˆํŽ˜์ด์ง€ ํด๋ก __header

Youmi Choi (Blake)ยท2021๋…„ 11์›” 26์ผ
0

MEMOIRS

๋ชฉ๋ก ๋ณด๊ธฐ
5/5
post-thumbnail

์™œ ๊ธ€์ž๊ฐ€ ์ ์šฉ์•ˆ๋˜๋‚˜ ํ–ˆ๋”๋‹ˆ
๋‹ซ๋Š” ํƒœ๊ทธ ์œ„์น˜ ์ž˜๋ชป๋จ.
์ˆ˜์ • ํ›„
๊ทธ๋ž˜๋„ ์ •๋ ฌ ์•ˆ๋˜์–ด ์ƒ๊ฐํ•ด๋ณด๋‹ˆ flex-direction์„ ์ž‘์„ฑ ์•ˆ ํ•จ.

๊ฒฐ๊ณผ : ํ–ˆ์ง€๋งŒ ์ œ์ž๋ฆฌ

์†Œ์Šค ํ™•์ธํ•˜๋‹ˆ

   <header>
      <div class="inner">
      <div class="head-title">
        <a href="#">์ž”์žฌ๋ฏธ์ฝ”๋”ฉ</a>
      </div>
      <div class="head-blog">
        <a href="#">์ž”์žฌ๋ฏธ์ฝ”๋”ฉ ๋ธ”๋กœ๊ทธ ๋ชจ์ž„</a>
      </div>
      </div>
    </header>

ํ•œ ์•„์ดํ…œ์”ฉ ๋‹ค div๋กœ ๋‚˜๋ˆ„์–ด์ ธ ์žˆ์—ˆ๋‹ค.
์ˆ˜์ • ํ›„
๊ทธ ๊ฐ๊ฐ์˜ div๋กœ ๋‚˜๋ˆ„์–ด์ง„ aํƒœ๊ทธ๋“ค์„ ๊ฐ์‹ผ
head-title์„ flex๋กœ ์„ค์ • ๋ฐ ์ •๋ ฌํ•ด์ฃผ์—ˆ๋‹ค.
๊ทธ๋ž˜๋„ ์ •๋ ฌ ์•ˆ๋จ.

๋‹ค์‹œ ์†Œ์Šค๋ฅผ ๋ณด๋‹ˆ flex-box์ธ head-title์—๋„ ๋†’์ด ๋„“์ด ์„ค์ •,
๊ทธ ๊ฒ‰์„ ๊ฐ์‹ผ inner๋„ ๋†’์ด ๋„“์ด๋ฅผ ๋‹ค ์ฃผ์–ด์•ผํ–ˆ๋‹ค.

๐Ÿ’ญ ๋Š๋‚€์  :

์ฒ˜์Œ์— ์†Œ์Šค ์—†์ด ํ˜ผ์ž ํด๋ก ํ•˜๋ ค๋‹ˆ ์ž˜ ์•ˆ๋˜์—ˆ๋Š”๋ฐ
์กฐ๊ธˆ์”ฉ ํผ์ฆ ๋งž์ถฐ์ง€๋Š”๋“ฏ ํ•˜์—ฌ ์žฌ๋ฐŒ์—ˆ๋‹ค.
๊ทธ๋ฆฌ๊ณ  ํ„ฐ๋“ํ•œ ๊ฒƒ์ด ์žˆ๋‹ค.

1> flex๋ฅผ ํ™œ์šฉํ•˜๋ ค๋ฉด html๋‚˜๋ˆŒ๋•Œ ํ•˜๋‚˜์”ฉ ๋‹ค ๋‚˜๋ˆ ์•ผํ•œ๋‹ค.
flex๋ฐ•์Šค์™€ item๋“ค์ด ๋  ๋ฉ์–ด๋ฆฌ๋“ค์„ ์ง€์ •ํ•˜๋Š” ๊ฒƒ.

๋งจ ์ฒ˜์Œ ์‹œ์ž‘๋•Œ๋Š” header๋ฅผ flex๋กœ ํ–ˆ์œผ๋‚˜
header๋Š” ๊ณต๊ฐ„์„ ์žก์•„์ค„ ๋ฟ์ด์˜€๋‹ค.

2> ๋†’์ด์™€ ๋„“์ด๋ฅผ ์ฃผ์–ด์•ผ ์ •์ƒ์ ์œผ๋กœ ์ •๋ ฌ.

๋†’์ด๋ฅผ flex-box์—๋งŒ ์ฃผ๋ฉด ๋œ๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ๋Š”๋ฐ ์ ์šฉ์ด ์•ˆ๋˜์–ด
๊ทธ ๊ฒ‰์„ ๊ฐ์‹ผ inner๋„ ๋†’์ด ๋„“์ด๋ฅผ ์ฃผ๋‹ˆ ์ •์ƒ ์ •๋ ฌ๋จ.

profile
๊พธ์ค€ํ•จ์„ ํ†ตํ•ด ์™„๋ฒฝ์„ ์ถ”๊ตฌํ•ฉ๋‹ˆ๋‹ค.

0๊ฐœ์˜ ๋Œ“๊ธ€