๐Ÿ‘ฉ‍๐ŸŽค ํ”„๋ก ํŠธ์—”๋“œ/css

    [CSS] Negative margin (์Œ์ˆ˜ ๋งˆ์ง„)

    Negative Margin (์Œ์ˆ˜ ๋งˆ์ง„) 1. static์ธ ๊ฒฝ์šฐ 1. top, left์— ์Œ์ˆ˜ ๋งˆ์ง„์„ ์ ์šฉํ•œ ๊ฒฝ์šฐ See the Pen Untitled by Minkyung Shin (@minkyung00) on CodePen. top ๋˜๋Š” left ๋ฐฉํ–ฅ์œผ๋กœ ํ•ด๋‹น ์š”์†Œ๊ฐ€ ์ด๋™ํ•œ๋‹ค ์ฒซ๋ฒˆ์งธ ์š”์†Œ์— margin-top: -50px๋ฅผ ํ•˜๋ฉด ๋‘๋ฒˆ์งธ, ์„ธ๋ฒˆ์งธ ์š”์†Œ๋„ ํ•จ๊ป˜ top ๋ฐฉํ–ฅ์œผ๋กœ 50px๋งŒํผ ์ด๋™ํ•œ๋‹ค 2. right, bottom์— ์Œ์ˆ˜ ๋งˆ์ง„์„ ์ ์šฉํ•œ ๊ฒฝ์šฐ See the Pen Untitled by Minkyung Shin (@minkyung00) on CodePen. ๋‹ค์Œ ์š”์†Œ๋ฅผ right ๋˜๋Š” bottom๋งŒํผ ์ด๋™์‹œํ‚จ๋‹ค. ์ฆ‰, ํ•ด๋‹น ์š”์†Œ์™€ ๋‹ค์Œ ์š”์†Œ๊ฐ€ ๊ฒน์น˜๊ฒŒ ๋œ๋‹ค ์ฒซ๋ฒˆ์งธ(top์— ์Œ์ˆ˜๋งˆ์ง„)๊ณผ๋Š” ๋‹ฌ๋ฆฌ ..

    display, position, float ์†์„ฑ ๊ฐ„์˜ ๊ด€๊ณ„

    Normal flow (์ผ๋ฐ˜์ ์ธ ํ๋ฆ„์œผ๋กœ ๋ฐฐ์น˜๋˜๋Š” ๊ฒฝ์šฐ) Normal flow๋ž€ ์ˆœ์ฐจ์ ์œผ๋กœ ๋ฐ•์Šค๊ฐ€ ๋ฐฐ์น˜๊ฐ€ ๋˜๋Š” ๊ฒฝ์šฐ๋‹ค Normal flow์—์„œ ๋ฐ•์Šค๋“ค์€ formatting context๋ฅผ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค. CSS 2.2 ์—์„œ๋Š” table, block, inline์ด ํ•ด๋‹น๋œ๋‹ค ๋ธ”๋ก ๋ ˆ๋ฒจ์˜ ๋ฐ•์Šค๋Š” block formatting์— ์†ํ•˜๊ณ  ์ธ๋ผ์ธ ๋ ˆ๋ฒจ์˜ ๋ฐ•์Šค๋Š” inline formatting์— ์†ํ•˜๊ณ  table formatting์€ https://www.w3.org/TR/CSS22/tables.html ์—ฌ๊ธฐ์— ์ž‘์„ฑ๋˜์–ด ์žˆ๋‹ค Block formatting context float, position์ด absolute์ธ ์š”์†Œ, ๋ธ”๋ก ๋ฐ•์Šค๋Š” ์•„๋‹ˆ์ง€๋งŒ inline-block, table-cell, table-caption๊ณผ ๊ฐ™..