๊ฐ€์ƒ์„ ํƒ์ž๋ฅผ ์‚ฌ์šฉํ•ด backgroud ๋„“์ด์™€ ๋†’์ด ์ ์šฉ

2021. 8. 4. 11:44ยท๐ŸฃcodeLab

๊ฐ€์ƒ์„ ํƒ์ž๋ฅผ ์‚ฌ์šฉํ•ด ์›ํ•˜๋Š” ๋„“์ด์™€ ๋†’์ด๋ฅผ calc๋กœ ๋งŒ๋“ค์–ด๋ณด์ž.

์ฐธ๊ณ ํ•œ ํ™ˆํŽ˜์ด์ง€ ์‚ผ์„ฑ๋ฐ˜๋„์ฒด

<section>section</section>
<div  class="wrap">
    <div class="inner">
        <ul>
            <li>box</li>
            <li>box</li>
            <li>box</li>
            <li>box</li>
        </ul>
    </div>
</div>
<section>section</section>
/******* reset CSS *******/
* { margin: 0; padding: 0; box-sizing: border-box; }
li { list-style: none; }

/******* custom CSS *******/
section { width: 100%; height: 150px; background: #e9e9e9; }
.wrap { position: relative; padding: 50px 0; }
/* wrap::before๋ฅผ ์ด์šฉํ•˜์—ฌ background-color๋ฅผ ๋งŒ๋“ค์–ด์ค€๋‹ค. */
.wrap::before {
    display: block;
    content: 'beforeBG';
    width: 100%;
    height: calc(100% - 150px);
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: -1;
}
.inner { position: relative; max-width: 800px; margin: auto; }
.inner ul::after { display: block; content: ''; clear: both; }
.inner ul li:not(:first-of-type) { float: left; width: 32%; margin-left: 2%; height: 200px; background: yellowgreen; }
.inner ul li:nth-of-type(2) { margin-left: 0; }
.inner ul li:first-of-type { width: 80%; height: 200px; margin: 0 auto 20px; background: gold; }

ํŒŒ๋ž‘์ƒ‰(bottom: 0)์„ ๊ธฐ์ค€์œผ๋กœ ์œ„์—์„œ 150px ๋–จ์–ด์ง„ ๊ณณ์— before์ด ์ ์šฉ๋œ๋‹ค.

์ €์ž‘์žํ‘œ์‹œ ๋น„์˜๋ฆฌ ๋™์ผ์กฐ๊ฑด (์ƒˆ์ฐฝ์—ด๋ฆผ)
'๐ŸฃcodeLab' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€
  • ์Šคํฌ๋กค ์‹œ ์œˆ๋„์šฐ ํ•˜๋‹จ์— ๊ณ ์ •ํ•˜๊ธฐ
  • darkmode ๋งŒ๋“ค์–ด๋ณด๊ธฐ
  • ํด๋ฆญ ๋˜๋Š” ์ˆซ์ž ์ž…๋ ฅ ์‹œ ๋ง์…ˆ ๊ตฌํ•˜๊ธฐ
  • sticky section scroll
jmjm
jmjm
  • jmjm
    /* jmjmjm */
    jmjm
  • ์ „์ฒด
    ์˜ค๋Š˜
    ์–ด์ œ
    • ๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ (140)
      • ๐Ÿ‘ฉ๐Ÿป‍๐Ÿ’ปSTUDY (101)
        • HTML (9)
        • CSS (25)
        • SASS (4)
        • JavaScript (19)
        • jQuery (9)
        • Publishing (8)
        • Git (11)
        • React (14)
        • Vue (0)
        • ์›น์ ‘๊ทผ์„ฑ (1)
        • Gulp (1)
      • ๐ŸฃcodeLab (28)
      • ๐ŸŒˆetc (8)
      • ๐Ÿฅฐ ์ผ์ƒ (2)
      • ๐ŸŒŸ์ฝ์–ด๋ณด๊ธฐ (1)
  • ๋ธ”๋กœ๊ทธ ๋ฉ”๋‰ด

    • ํ™ˆ
    • ํƒœ๊ทธ
  • ๋งํฌ

  • ๊ณต์ง€์‚ฌํ•ญ

  • ์ธ๊ธฐ ๊ธ€

  • ํƒœ๊ทธ

    ๋ง์ค„์ž„ tooltip
    ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ๊ตฌ์กฐ๋ถ„ํ•ดํ• ๋‹น
    ๋ง์ค„์ž„ ํˆดํŒ
    ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ํ‘œํ˜„์‹ ๋ฌธ
    javascript htmlcollection nodelist
    CSS ์„ ํƒ์ž
    javascript ์ปฌ๋ ‰์…˜
    ํ˜•์ œ์ธ์ ‘์ž display none
    vscode ๋‹จ์ถ•ํ‚ค
    sass
    css flex
    ์›น์ ‘๊ทผ์„ฑ
    css ํ˜•์ œ์ธ์ ‘์ž ์•ˆ๋ผ์š”
    ํ˜•์ œ์ธ์ ‘์ž ์•ˆ๋˜๋Š” ์ด์œ 
    sticky jsfiddle
    javascript ๊ตฌ์กฐ๋ถ„ํ•ดํ• ๋‹น
    ๊ตฌ์กฐ๋ถ„ํ•ดํ• ๋‹น ์ข…๋ฅ˜
    ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ํ‘œํ˜„์‹๋ฌธ
    ํ˜•์ œ์ธ์ ‘์ž
    javascript nodelist
    HTML Form
    ๋ง์ค„์ž„ hover
    ๋ง์ค„์ž„ ํ˜ธ๋ฒ„
    react import export
    javascript htmlcollection
    ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์ปฌ๋ ‰์…˜
    css ๊ฐ€์ƒ์„ ํƒ์ž
    ์•„์ฝ”๋””์–ธ๋ฉ”๋‰ด
    sass compiler
    html collection
  • ์ตœ๊ทผ ๋Œ“๊ธ€

  • ์ตœ๊ทผ ๊ธ€

  • hELLOยท Designed By์ •์ƒ์šฐ.v4.10.3
jmjm
๊ฐ€์ƒ์„ ํƒ์ž๋ฅผ ์‚ฌ์šฉํ•ด backgroud ๋„“์ด์™€ ๋†’์ด ์ ์šฉ
์ƒ๋‹จ์œผ๋กœ

ํ‹ฐ์Šคํ† ๋ฆฌํˆด๋ฐ”