๐Ÿ’›[๋ถ€์ŠคํŠธ์ฝ”์Šค_์›น UI ๊ฐœ๋ฐœ] 15. ํƒญ

๐Ÿ‘พยท2021๋…„ 1์›” 29์ผ
0

HTML & CSS

๋ชฉ๋ก ๋ณด๊ธฐ
15/20
post-custom-banner

ํƒญ ์†Œ๊ฐœ

ํƒญ : ์‚ฌ์ „์  ์˜๋ฏธ๋กœ ์ƒ‰์ธํ‘œ, ์‹๋ณ„ํ‘œ๋ผ๋Š” ๋œป
์ƒ‰์ธ์€ ๋ชฉ๋ก๊ณผ ๊ฐ™์€ ์˜๋ฏธ๋กœ ์“ฐ์ธ๋‹ค

๋ฐ์ดํ„ฐ๋ฅผ ๊ธฐ๋กํ•  ๊ฒฝ์šฐ ๊ทธ ๋ฐ์ดํ„ฐ์˜ ์ด๋ฆ„, ํฌ๊ธฐ ๋“ฑ์˜ ์†์„ฑ๊ณผ ๊ทธ ๊ธฐ๋ก ์žฅ์†Œ๋“ฑ์„ ํ‘œ์‹œํ•˜๋Š”๊ฒƒ

์ฆ‰ ์ฐธ์กฐ์šฉ์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ƒ‰์ธํ‘œ ๋˜๋Š” ์ธ๋ฑ์Šค๋ผ๊ณ ๋„ ๋ถ€๋ฅธ๋‹ค.

ํƒญ UI์˜ ํŠน์ง•

์—ฌ๋Ÿฌ ๋ฌธ์„œ ๋˜๋Š” ํŒจ๋„์„ ํ•˜๋‚˜์˜ ์ฐฝ์— ๋‘๊ณ  ์ „ํ™˜ํ•˜์—ฌ ๋ณผ ์ˆ˜ ์žˆ๋„๋ก ํ•œ ์ธํ„ฐํŽ˜์ด์Šค.
= ๊ฐ™์€ ํŽ˜์ด์ง€ ๋‚ด์—์„œ ํƒญ ๋ฉ”๋‰ด์™€ ๊ทธ์— ์—ฐ๊ด€๋œ ๋‚ด์šฉ์„ ํ•œ์ •๋œ ์˜์—ญ์—์„œ ๊ทธ์— ํ•ด๋‹น๋˜๋Š” ์ฝ˜ํ…์ธ  ๋‚ด์šฉ๋“ค์„ ํ•œ์ •๋œ ์˜์—ญ์—์„œ ๋ชจ๋‘ ์ œ๊ณต์„ ํ•  ์ˆ˜ ์žˆ๋Š” ์žฅ์ ์„ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” UI

ํƒญ๊ณผ ๋‚ด๋น„๊ฒŒ์ด์…˜์€ UI๊ฐ€ ์œ ์‚ฌํ•˜์—ฌ ์‚ฌ์šฉ์‹œ ๊ธฐ๋Šฅ์„ ํ—ท๊ฐˆ๋ฆด ์ˆ˜์žˆ๋‹ค.

ํƒญ๊ณผ ๋‚ด๋น„๊ฒŒ์ด์…˜์˜ ์ฐจ์ด

์‚ฌ์šฉ์ž๊ฐ€ ํƒญ ๋˜๋Š” ๋‚ด๋น„๊ฒŒ์ด์…˜์„ ํด๋ฆญํ–ˆ์„๋•Œ

  • ๋‚ด๋น„๊ฒŒ์ด์…˜: ํŽ˜์ด์ง€ ์ „ํ™˜์ด ๋˜์–ด์„œ ๋‹ค๋ฅธ ํŽ˜์ด์ง€๋กœ ์ด๋™
  • ํƒญ : ํ™”๋ฉด ์ด๋™ ์—†์ด ์„ ํƒ๋œ ํƒญ๊ณผ ์—ฐ๊ด€๋œ ์ฝ˜ํ…์ธ ๊ฐ€ ๊ฐ€๊นŒ์šด ์˜์—ญ์—์„œ ๋ณด์ด๊ฒŒ ๋œ๋‹ค.
    ๋”ฐ๋ผ์„œ ํƒญ์˜ ๊ฒฝ์šฐ๋Š” ํ•œ์ •๋œ ์˜์—ญ์—์„œ ์—ฌ๋Ÿฌ๊ฐ€์ง€ ์ƒ‰์ธ์— ๋งž๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ™์ด ํ•œ๊บผ๋ฒˆ์— ๋ณด์—ฌ์ค„ ์ˆ˜ ์žˆ๋Š” ์žฅ์ ์„ ๊ฐ–๊ณ  ์žˆ๋‹ค.

์‚ฌ์šฉ ์˜ˆ์‹œ

๋„ค์ด๋ฒ„ ๋‰ด์Šค ์‚ฌ์ดํŠธ -> ๊ฐ€์žฅ ๋งŽ์ด ๋ณธ ๋‰ด์Šค
๋„ค์ด๋ฒ„ ๋งŒํ™” ์‚ฌ์ดํŠธ -> ์ธ๊ธฐ ๊ธ‰์ƒ์Šน ๋งŒํ™”, 20๋Œ€ ์‹ค์‹œ๊ฐ„ ์ธ๊ธฐ ๋งŒํ™”
๋„ค์ด๋ฒ„ ํ˜ธํ…” ํŽ˜์ด์ง€

ํƒญ์€ ํŽ˜์ด์ง€ ์ด๋™์—†์ด ๊ฐ™์€ ํ™”๋ฉด ๋‚ด์—์„œ ์ฝ˜ํ…์ธ ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋Š” ์žฅ์ ์ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ๋„ค๋น„๊ฒŒ์ด์…˜๊ณผ ํƒญ ๋‘ UI์— ๋Œ€ํ•œ ์ฐจ์ด๋ฅผ ๊ตฌ๋ถ„ํ•ด์„œ ์ดํ•ดํ•˜์ž

ํƒญ์€ ๋‹ค์–‘ํ•œ ์›น ์‚ฌ์ดํŠธ์—์„œ ์ž์ฃผ ์‚ฌ์šฉ๋˜๊ณ  ์žˆ๋Š” UI์ด๋‹ค.


ํƒญ ์ œ์ž‘

ํƒญ์˜ ์ฃผ์š” ๊ธฐ๋Šฅ

ํƒญ์€ ํƒญ ๋ชฉ๋ก๊ณผ ํŒจ๋„ ์˜์—ญ์œผ๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ๋‹ค.

  • ํƒญ ๋ชฉ๋ก์€ ์ด 3๊ฐœ์˜ ์•„์ดํ…œ ๊ฐ€์ง
  • ํƒญ ๋ชฉ๋ก์ด ์„ ํƒ๋˜๊ฑฐ๋‚˜ ๋งˆ์šฐ์Šค ์˜ค๋ฒ„ํ–ˆ์„๋•Œ ๊ทธ์— ๋Œ€ํ•œ ํ™œ์„ฑํ™” ํ‘œ์‹œ.
  • ํƒญ ํŒจ๋„ ์˜์—ญ์—์„œ๋Š” ํ•ด๋‹น ์ฝ˜ํ…์ธ ์— ํ•ด๋‹น๋˜๋Š” ๋‚ด์šฉ์ด ์ตœ๋Œ€ 10๊ฐœ๊นŒ์ง€ ๋ณด์—ฌ์ง
  • ํ…์ŠคํŠธ๋“ค์€ ๋งˆ์šฐ์Šค ์˜ค๋ฒ„ํ–ˆ์„๋•Œ ํšจ๊ณผ ์ ์šฉ
  • ๋‹ค๋ฅธ ๋ชฉ๋ก์„ ์„ ํƒํ–ˆ์„๋•Œ๋„ ํƒญ ํŒจ๋„ ์•ˆ์— ํ•ด๋‹น๋˜๋Š” ๋ชฉ๋ก์˜ ์ฝ˜ํ…์ธ  ์ •๋ณด๊ฐ€ ํƒญ ํŒจ๋„ ์˜์—ญ ์•ˆ์—์„œ ๋ณด์—ฌ์ค˜์•ผ ํ•œ๋‹ค.

์Šคํƒ€์ผ ์ •๋ณด

  • ํƒญ ๋ชฉ๋ก
    ๋†’์ด 50px
    ํฐํŠธ 16px #999
    ๋ผ์ธ 1px #eee
    ์˜ค๋ฒ„/ํ™œ์„ฑํ™” ์‹œ ํฐํŠธ 16px bold #000

  • ํƒญ ํŒจ๋„
    ๋†’์ด ์ตœ์†Œ 350px
    ๋ผ์ธ 1px #eee
    ์ฝ˜ํ…์ธ  ํฐํŠธ 14px #333 1์ค„ ๋ง์ค„์ž„
    ์ฝ˜ํ…์ธ  ์˜ค๋ฒ„ ์‹œ ํฐํŠธ 14px bold

์ฃผ์š” ํƒœ๊ทธ ๋ฐ ์Šคํƒ€์ผ

  • HTML
    div, ul, li, a, span

  • CSS
    display, position, border, margin, padding, table-layout, box-sizing, text-align, :hover


<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <link rel="stylesheet" href="tab.css">
    <title>ํƒญ ์‹ค์Šต</title>
</head>
<body>
  <!--tab UI๋ฅผ ๊ฐ์‹ธ๋Š” ์ตœ์ƒ์œ„ ๋ถ€๋ชจ-->
    <div class="tab_wrap">
        <!-- ํƒญ ๋ชฉ๋ก -->
        <ul class="tab">
            <!-- ํƒญ ๋ชฉ๋ก ํ™œ์„ฑํ™” ํด๋ž˜์Šค active ์ถ”๊ฐ€ -->
            <li class="tab_item active">
                <button type="button" class="tab_btn">์ธ๊ธฐ์ˆœ</button>
            </li>
            <li class="tab_item">
                <button type="button" class="tab_btn">์กฐํšŒ์ˆœ</button>
            </li>
            <li class="tab_item">
                <button type="button" class="tab_btn">๋‚ ์งœ์ˆœ</button>
            </li>
        </ul>
        <!-- ์ธ๊ธฐ์ˆœ ํƒญ ํŒจ๋„ wrap -->
        <!-- ํƒญ ํŒจ๋„ ํ™œ์„ฑํ™” ํด๋ž˜์Šค active ์ถ”๊ฐ€ -->
        <div class="tab_panel_wrap active">
            <h3>์ธ๊ธฐ์ˆœ ์ฝ˜ํ…์ธ </h3>
            <!-- ํƒญ ํŒจ๋„ -->
            <ol class="tab_panel">
                <li class="panel_item"><a href="#" class="item_link">1. ์„œ์šธ~๋Ÿฐ๋˜ 30๋ถ„ ๋งŒ์— ๋„์ฐฉโ€ฆ์žฅ๊ฑฐ๋ฆฌ ๋กœ์ผ“ ์—ฌํ–‰, 2030๋…„ ๋‚ด ๊ฐ€๋Šฅ</a></li>
                <li class="panel_item"><a href="#" class="item_link">2. ์›ฌ๋งŒํ•ด์„  ์•ˆ ์ฃฝ๋Š”๋‹ค๋Š” '๋ฌผ๊ณฐ'์—๊ฒŒ์„œ ๊ทนํ•œ์ƒ์กด ์—ด์‡  ์ฐพ๋Š”๋‹ค</a></li>
                <li class="panel_item"><a href="#" class="item_link">3. ์• ํ”Œ, '์—์–ดํŒŸ 2์„ธ๋Œ€' ๋ฐœํ‘œ</a></li>
                <li class="panel_item"><a href="#" class="item_link">4. ํ•œ๊ตญ์–ด ์ง€์›ํ•˜๋Š” ๋ฏธ์Šน์ธ ์„ฑ์ธ๊ฒŒ์ž„๋ฌผ ๋ฒ”๋žŒ</a></li>
                <li class="panel_item"><a href="#" class="item_link">5. [์ด์Šˆ+] "ํ˜์‹ ์—†๋Š” ๊ฐ€๊ฒฉ์ธ์ƒ"โ€ฆ์—์–ดํŒŸ2, ์• ํ”Œ ์ถฉ์„ฑ๊ณ ๊ฐ๋งˆ์ € ๋– ๋‚œ๋‹ค</a></li>
                <li class="panel_item"><a href="#" class="item_link">6. KAIST, ์„ธํƒ ๊ฐ€๋Šฅํ•œ ์ž…๋Š” ๋””์Šคํ”Œ๋ ˆ์ด ๊ฐœ๋ฐœ</a></li>
                <li class="panel_item"><a href="#" class="item_link">7. "์„ธ๊ณ„ ์ตœ์ดˆ 5G ์ƒ์šฉํ™”"โ€ฆ์‚ผ์„ฑ '๊ฐค๋Ÿญ์‹œS10 5G' ๋‹ค์Œ๋‹ฌ 5์ผ ์ถœ์‹œ</a></li>
                <li class="panel_item"><a href="#" class="item_link">8. ์ค‘๊ตญ์—…์ฒด, ๊ตญ์‚ฐ ๋ฐฐํ„ฐ๋ฆฌ ํƒ‘์žฌ ์ „๊ธฐ์ฐจ 5๋Œ€ ํ˜•์‹์Šน์ธ ์‹ ์ฒญ</a></li>
                <li class="panel_item"><a href="#" class="item_link">9. ็พŽ ๋งˆ์ดํฌ๋ก  '์ด๋ก€์ ' D๋žจยท๋‚ธ๋“œ ๊ฐ์‚ฐโ€ฆ๋ฉ”๋ชจ๋ฆฌ ์—…ํ™ฉ ํšŒ๋ณต ๊ธฐ๋Œ€</a></li>
                <li class="panel_item"><a href="#" class="item_link">10. ์•„ํ”์‚ด ์˜์‚ฌ์˜ ๊ฑด๊ฐ•๋น„๊ฒฐ์€ โ€˜๋งค์ผ 15๋ถ„ ๋งจ์† ์šด๋™โ€™</a></li>          
            </ol>
        </div>
        <!-- ์กฐํšŒ์ˆœ ํƒญ ํŒจ๋„ wrap -->
        <div class="tab_panel_wrap">
            <h3>์กฐํšŒ์ˆœ ์ฝ˜ํ…์ธ </h3>
            <!-- ํƒญ ํŒจ๋„ -->
            <ol class="tab_panel">
                <li class="panel_item"><a href="#" class="item_link">1. ์„œ์šธ~๋Ÿฐ๋˜ 30๋ถ„ ๋งŒ์— ๋„์ฐฉโ€ฆ์žฅ๊ฑฐ๋ฆฌ ๋กœ์ผ“ ์—ฌํ–‰, 2030๋…„ ๋‚ด ๊ฐ€๋Šฅ</a></li>
                <li class="panel_item"><a href="#" class="item_link">2. ์›ฌ๋งŒํ•ด์„  ์•ˆ ์ฃฝ๋Š”๋‹ค๋Š” '๋ฌผ๊ณฐ'์—๊ฒŒ์„œ ๊ทนํ•œ์ƒ์กด ์—ด์‡  ์ฐพ๋Š”๋‹ค</a></li>
                <li class="panel_item"><a href="#" class="item_link">3. ์• ํ”Œ, '์—์–ดํŒŸ 2์„ธ๋Œ€' ๋ฐœํ‘œ</a></li>
                <li class="panel_item"><a href="#" class="item_link">4. ํ•œ๊ตญ์–ด ์ง€์›ํ•˜๋Š” ๋ฏธ์Šน์ธ ์„ฑ์ธ๊ฒŒ์ž„๋ฌผ ๋ฒ”๋žŒ</a></li>
                <li class="panel_item"><a href="#" class="item_link">5. [์ด์Šˆ+] "ํ˜์‹ ์—†๋Š” ๊ฐ€๊ฒฉ์ธ์ƒ"โ€ฆ์—์–ดํŒŸ2, ์• ํ”Œ ์ถฉ์„ฑ๊ณ ๊ฐ๋งˆ์ € ๋– ๋‚œ๋‹ค</a></li>
            </ol>
        </div>
        <!-- ๋‚ ์งœ์ˆœ ํƒญ ํŒจ๋„ wrap -->
        <div class="tab_panel_wrap">
            <h3>๋‚ ์งœ์ˆœ ์ฝ˜ํ…์ธ </h3>
            <!-- ํƒญ ํŒจ๋„ -->
            <ol class="tab_panel">
                <li class="panel_item"><a href="#" class="item_link">1. ์„œ์šธ~๋Ÿฐ๋˜ 30๋ถ„ ๋งŒ์— ๋„์ฐฉโ€ฆ์žฅ๊ฑฐ๋ฆฌ ๋กœ์ผ“ ์—ฌํ–‰, 2030๋…„ ๋‚ด ๊ฐ€๋Šฅ</a></li>
                <li class="panel_item"><a href="#" class="item_link">2. ์›ฌ๋งŒํ•ด์„  ์•ˆ ์ฃฝ๋Š”๋‹ค๋Š” '๋ฌผ๊ณฐ'์—๊ฒŒ์„œ ๊ทนํ•œ์ƒ์กด ์—ด์‡  ์ฐพ๋Š”๋‹ค</a></li>
                <li class="panel_item"><a href="#" class="item_link">3. ์• ํ”Œ, '์—์–ดํŒŸ 2์„ธ๋Œ€' ๋ฐœํ‘œ</a></li>
                <li class="panel_item"><a href="#" class="item_link">4. ํ•œ๊ตญ์–ด ์ง€์›ํ•˜๋Š” ๋ฏธ์Šน์ธ ์„ฑ์ธ๊ฒŒ์ž„๋ฌผ ๋ฒ”๋žŒ</a></li>
                <li class="panel_item"><a href="#" class="item_link">5. [์ด์Šˆ+] "ํ˜์‹ ์—†๋Š” ๊ฐ€๊ฒฉ์ธ์ƒ"โ€ฆ์—์–ดํŒŸ2, ์• ํ”Œ ์ถฉ์„ฑ๊ณ ๊ฐ๋งˆ์ € ๋– ๋‚œ๋‹ค</a></li>
                <li class="panel_item"><a href="#" class="item_link">6. KAIST, ์„ธํƒ ๊ฐ€๋Šฅํ•œ ์ž…๋Š” ๋””์Šคํ”Œ๋ ˆ์ด ๊ฐœ๋ฐœ</a></li>
                <li class="panel_item"><a href="#" class="item_link">7. "์„ธ๊ณ„ ์ตœ์ดˆ 5G ์ƒ์šฉํ™”"โ€ฆ์‚ผ์„ฑ '๊ฐค๋Ÿญ์‹œS10 5G' ๋‹ค์Œ๋‹ฌ 5์ผ ์ถœ์‹œ</a></li>
                <li class="panel_item"><a href="#" class="item_link">8. ์ค‘๊ตญ์—…์ฒด, ๊ตญ์‚ฐ ๋ฐฐํ„ฐ๋ฆฌ ํƒ‘์žฌ ์ „๊ธฐ์ฐจ 5๋Œ€ ํ˜•์‹์Šน์ธ ์‹ ์ฒญ</a></li>            </ol>
        </div>
    </div>
</body>
</html>

๋„ค๋น„๊ฒŒ์ด์…˜์€ ๋งˆ์šฐ์Šค ํด๋ฆญ ์ด๋ฒคํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด ์•ต์ปค๋กœ ๊ตฌ์กฐ๋ฅผ ๋งŒ๋“ค์–ด์„œ ์ž‘์—…ํ–ˆ๋‹ค๋ฉด ํƒญ์€ ๋ฒ„ํŠผ ๊ตฌ์กฐ ์ด์šฉ.

์•ต์ปค๋Š” ๋‹ค๋ฅธ ํŽ˜์ด์ง€๋กœ ์ด์ „ํ•˜๋Š” ์‹œ๋งจํ‹ฑ์ ์ธ ๋งˆํฌ์—… ๊ตฌ์กฐ์ด๊ณ , ํ˜„์žฌ๋Š” ๊ฐ™์€ ํŽ˜์ด์ง€ ๋‚ด์—์„œ ์ฝ˜ํ…์ธ ๋ฅผ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•œ ์šฉ๋„๋กœ ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ํƒญ์—์„œ๋Š” ๋ฒ„ํŠผ์„ ์“ฐ๋Š”๊ฒŒ ์‹œ๋งจํ‹ฑ ๋งˆํฌ์—… ๊ตฌ์กฐ์—์„œ ๋” ์ ํ•ฉํ•˜๋‹ค.

ํƒญ ํŒจ๋„์˜ ํƒ€์ดํ‹€(h3)์€ ๊ฒฐ๊ณผ๋ฌผ์—์„œ๋Š” ๋…ธ์ถœ๋˜์ง€ ์•Š๋Š” ํƒ€์ดํ‹€.
์จ์ฃผ๋Š” ์ด์œ ๋Š” ์ ‘๊ทผ์„ฑ ์ธก๋ฉด์—์„œ ํƒญ ๋ชฉ๋ก๊ณผ ํƒญ ํŒจ๋„์ด ์—ฐ๊ฒฐ๋˜์—ˆ๋‹ค๋Š” ์˜๋ฏธ๋กœ ํƒ€์ดํ‹€์„ ํƒญ ํŒจ๋„์•ˆ์— ๋„ฃ์–ด์ฃผ๊ฒŒ ๋œ๋‹ค. ์•ˆ๋„ฃ์–ด์ค˜๋„ ๊ฒฐ๊ณผ๋ฌผ์—์„œ๋Š” ํฐ ์˜ํ–ฅ์„ ์ฃผ์ง„ ์•Š์ง€๋งŒ ์ข€ ๋” ์‹œ๋งจํ‹ฑํ•œ ๋งˆํฌ์—… ๊ตฌ์กฐ์—์„œ๋Š” ํƒ€์ดํ‹€์„ ๋„ฃ๋Š”๊ฒƒ์ด ๋” ์ข‹์€ ์ฝ”๋“œ ๋ฐฉ๋ฒ•.
๋˜ํ•œ ๋ณดํ†ต ํƒญ ์˜์—ญ๊ฐ™์€ ๊ฒฝ์šฐ๋Š” ์ฝ˜ํ…์ธ  ๋‚ด๋ถ€๋‚˜ aside ์˜์—ญ์— ๋“ค์–ด๊ฐ€๊ธฐ ๋•Œ๋ฌธ์—, ๋ณดํ†ต h1์ด๋‚˜ h2๊ฐ€ ์‚ฌ์šฉ๋˜๋Š” ๊ฒฝ์šฐ๋Š” ๋“œ๋ฌผ์–ด์„œ h3๋กœ ํƒ€์ดํ‹€์„ ๋„ฃ์–ด์ค€๊ฒƒ.


@charset "UTF-8";

/* ๊ธฐ๋ณธ ์Šคํƒ€์ผ */
body {
    font-family: '๋‚˜๋ˆ”๊ณ ๋”•', NanumGothic, Dotum, '๋‹์›€', sans-serif;
    font-size: 14px;
    line-height: 16px;
}
body, ul, ol, li, div, a, button {
    margin:0;
    padding:0;
}
ul, ol {
    list-style:none;
}
a {
    color: inherit;
    text-decoration: none;
}

/* ํƒญ ์ œ์ž‘ */
.tab_wrap {
    width: 300px; /*์ „์ฒด ํƒญ UI์˜ ๋„ˆ๋น„๋ฅผ 300px๋กœ ๊ณ ์ •*/
    margin: 20px auto 0; /*๊ฐ€์šด๋ฐ ์ •๋ ฌ*/
}
.tab:after { /*float ํ•ด์ œ*/
    display: block;
    content: '';
    clear: both;
    /*๋ถ€๋ชจ๊ฐ€ ์ž์‹์˜ ๋†’์ด๊ฐ’์„ ์ธ์ง€ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋งŒ๋“ฆ*/
}
.tab_item {
    float: left; /*๋ฒ„ํŠผ์ด ํ•˜๋‹จ์œผ๋กœ ๋–จ์–ด์ง€๋Š” ํ˜„์ƒ ํ•ด๊ฒฐ*/
    /*float ์„ ์–ธ -> ๋ฐ˜๋“œ์‹œ ํ•ด์ œํ•˜๋Š” ์Šต๊ด€ ๋“ค์ด๊ธฐ*/
}
.tab_btn {
    width: 100px;
    height: 50px;
    font-size: 16px;
    color: #999;
    background-color: transparent; /*๊ธฐ๋ณธ ๋ฒ„ํŠผ ์Šคํƒ€์ผ ์ดˆ๊ธฐํ™”*/
    border: 1px solid #eee;
    outline: 0; /*๊ธฐ๋ณธ ๋ฒ„ํŠผ ์Šคํƒ€์ผ ์ดˆ๊ธฐํ™”*/
    cursor: pointer; /*๋งˆ์šฐ์Šค ์˜ค๋ฒ„ ์‹œ ์†๊ฐ€๋ฝ ๋ชจ์–‘*/
    
    /*์›๋ž˜ border์˜ ๊ฐ’์ด ๋„ˆ๋น„์™€ ๋†’์ด์— ์˜ํ–ฅ์„ ๋ฏธ์น˜๋Š”๋ฐ, button์˜ ๊ธฐ๋ณธ์ ์ธ ์Šคํƒ€์ผ์— box-sizing:border-box๊ฐ€ ์„ ์–ธ์ด ๋˜์–ด์žˆ์œผ๋ฏ€๋กœ border๋ฅผ ์ถ”๊ฐ€ํ•ด๋„ ์ „์ฒด ๋„ˆ๋น„์™€ ๋†’์ด๊ฐ’ ๋ณ€ํ•˜์ง€ ์•Š๋Š”๋‹ค.*/
}

.tab_item + .tab_item .tab_btn { 
    width: 101px; /*์™ผ์ชฝ์œผ๋กœ 1px์”ฉ ์ด๋™ -> ์šฐ์ธก์— ์—ฌ๋ฐฑ 2px ๋น„์–ด๋ณด์ด๋Š” ๋ฌธ์ œ ํ•ด๊ฒฐ*/
    margin-left: -1px; /*border ๊ฒน์นจ ํ˜„์ƒ ํ•ด๊ฒฐ*/
}

/* ํƒญ ๋ชฉ๋ก ์˜ค๋ฒ„ ์‹œ, ํ™œ์„ฑํ™” ์‹œ ํšจ๊ณผ */
.tab_item .tab_btn:hover,
.tab_item.active .tab_btn {
    font-weight: bold;
    color: #000;
    border-bottom: 0; /* ํ•˜๋‹จ ๋ผ์ธ ๊ฐ์ถ”๊ธฐ */
}

.tab_panel_wrap {
    display: none; /* ํƒญ ํŒจ๋„์€ ๊ธฐ๋ณธ ๋น„๋…ธ์ถœ ์ฒ˜๋ฆฌ */
}

.tab_panel_wrap.active {
    display: block; /* ํ™œ์„ฑํ™” ์‹œ ํƒญ ํŒจ๋„ ๋…ธ์ถœ ์ฒ˜๋ฆฌ */
}

.tab_panel_wrap {
    min-height: 350px; /*๋ฆฌ์ŠคํŠธ์˜ ๊ฐฏ์ˆ˜๊ฐ€ ๋ชจ์ž๋ž„๋•Œ ๋ฐ•์Šค๊ฐ€ ์ค„์–ด๋“œ๋Š” ํ˜„์ƒ์„ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•œ ๋ฐฉ์–ด์ฝ”๋“œ ์ธก๋ฉด*/
    padding: 20px;
    border: 1px solid #eee;
    border-top: 0; /* ์ƒ๋‹จ ๋ผ์ธ ๊ฐ์ถ”๊ธฐ. border ๊ฒน์นจ ํ˜„์ƒ ํ•ด๊ฒฐ */
    box-sizing: border-box; /* ๋†’์ด์— border, padding ํฌํ•จํ•˜์ง€ ์•Š๊ธฐ ์œ„ํ•ด*/
}

.tab_panel_wrap h3 {
    /* ์š”์†Œ ๊ฐ์ถ”๊ธฐ ์†์„ฑ์€ blind ํด๋ž˜์Šค๋กœ ๋Œ€์ฒด ๊ฐ€๋Šฅ(HTML&CSS ํ™œ์šฉ>IR๊ธฐ๋ฒ• ๊ฐ•์ขŒ ์ฐธ๊ณ )  */
    position: absolute;
    z-index: -1;
    color: transparent;
}

.item_link {
    display: block; /*item_link๋ฅผ ๊ฐ์‹ธ๊ณ ์žˆ๋Š” li ์˜์—ญ์— ๊ฝ‰ ์ฐจ๊ฒŒ๋” ์žก๊ธฐ ์œ„ํ•ด*/
    font-size: 14px;
    line-height: 30px;
    color: #333;
    /*๋ง์ค„์ž„ ์ฒ˜๋ฆฌ*/
    overflow: hidden; 
    white-space: nowrap;
    text-overflow: ellipsis;
}

.panel_item:hover .item_link {
    font-weight: bold;
}

ํ•œ์ค„ ๋ง์ค„์ž„ ์ฒ˜๋ฆฌ๋Š” overflow:hidden, white-space:nowrap, text-overflow:ellipsis, display:block ๊ผญ ๋“ค์–ด๊ฐ€์•ผํ•จ

์‹ค๋ฌด์—์„œ๋Š” activeํด๋ž˜์Šค๋ฅผ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ์ œ์–ดํ•จ

์ •๋ฆฌ

  • ํƒญ ๋ชฉ๋ก ์™ธ๊ณฝ์„  ๊ฐ์ถค border:0
  • ํ…์ŠคํŠธ ๋ง์ค„์ž„
    • text-overflow:ellipsis
      ...์ฒ˜๋ฆฌ
    • overflow:hidden
      ํ…์ŠคํŠธ๊ฐ€ ๋„˜์–ด๊ฐ€๋Š” ๊ฒฝ์šฐ ํ•ด๋‹น ์˜์—ญ์„ ๋ฒ—์–ด๋‚œ ํ…์ŠคํŠธ๋Š” ๋ณด์ด์ง€ ์•Š๊ฒŒ๋” ์ฒ˜๋ฆฌ
    • white-space:nowrap
      ํ…์ŠคํŠธ๊ฐ€ ์˜์—ญ์„ ๋„˜์–ด๊ฐˆ๋•Œ ์ž๋™ ๋ง์ค„์ž„์ด ๋˜๋Š” ๋ถ€๋ถ„ ๋ฐฉ์ง€

ํ…์ŠคํŠธ ๋ง์ค„์ž„์€ ๊ณต์‹์ฒ˜๋Ÿผ ์‚ฌ์šฉ๋˜๋ฏ€๋กœ 3๊ฐ€์ง€ ๋ถ€๋ถ„ ๋ชจ๋‘ ์™ธ์šฐ๊ธฐ

  • ํƒญ ํŒจ๋„ ์ตœ์†Œ ๋†’์ด min-height
  • ํƒญ ํŒจ๋„ ๊ณ ์ • ๋†’์ด(์—ฌ๋ฐฑ ํฌํ•จ) box-sizing:border-box
post-custom-banner

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