๐ฉ๐ป ์์นจ ์์ต:: CSS
Block level elements(๋ธ๋ก ์์)
Position property
1. static: the default value (it does not need to be specified)
2. relative: to position an element relative to its default static position on the web page
3. absolute:When an element's position is set to abosolute, all other elements on the page will ignore the element and act like it is not present on the page.
4. fixed: We can fix an element to a specific position on the page (regardless of user scrolling) by setting its position to fixed
๐ฉ๐ค ์์ ์์
1. ์์ ํ์ด
- ํผ๋๋ฐฑ: margin์ผ๋ก ์ถฉ๋ถํ ํด๊ฒฐ ๊ฐ๋ฅํ ๊ฒ์ ์๋ก์ด ๊ฐ๋ (display)๋ก ํด๊ฒฐํ๋ ค ํ๋ค. ๊ธฐ์กด์ ๊ฐ๋ ์ ์ ์ดํดํ๊ณ ์๋ ๊ฒ์ด ์ค์ํ๋ค.)
- html: ์ฝํ ์ธ ์์ฒด๋ณด๋ค ๋ ์ด์์, ๋ฉ์ด๋ฆฌ ๊ตฌ์กฐ(๊ธฐ๋ณธ ๋ผ๋)๋ฅผ ์ ๋๋ก ์ก๊ณ ์ถ๋ฐ, ์ต์ํ์ ๋งํฌ์ html๋ก๋ถํฐ ์์ํ ํ์๊ฐ ์๋ค.
- ๋ด๊ฐ ์์ฑํ์ง ์์ ๊ฒฐ๊ณผ๊ฐ ์์ผ๋ฉด ๊ด์ฌ์ ๊ฐ์ง๊ฒ (body{margin: 0;})
์? ์ฌ์ฉ์ ์์ด์ ํธ ์คํ์ผ์ํธ(๋ธ๋ผ์ฐ์ ๊ฐ ์ ๊ณตํ๋ ๊ธฐ๋ณธ๊ฐ, ์ฆ ๋ธ๋ผ์ฐ์ ๋ง๋ ์๋ฐ๋ค์ด ํ๊ทธ์ ํ์ ์ ๊ธฐ์ค์ผ๋ก ์ ํด๋์ ๊ธฐ๋ณธ๊ฐ)์ ์ํฅ์ ๋ฐ์ ์์๊ณผ ๋ค๋ฅด๊ฒ ์กฐ์ ๋์ด ์๋ ๊ฒฝ์ฐ๊ฐ ์๊ธฐ ๋๋ฌธ
auto: ๋ธ๋ผ์ฐ์ ๊ฐ ์๋์ผ๋ก ๊ณ์ฐํ๋ ๊ฐ: ์ง๊ณ ๋ถ๋ชจ๊ฐ ์ ๊ณตํด์ฃผ๋ ์ฝํ ์ธ ์์ญ(containing block)์ ๋๋น ์ฆ ๋ถ๋ชจ์ ๋๋น ๋งํผ ๊ฐ๋ ์ฐจ๊ฒ ์๋(auto)์ผ๋ก ๊ณ์ฐํด์ ์ ์ฉํด์ค๋ค.
Inherit(์์)
inherit ํ๋ ์ด์ ? ๋ธ๋ผ์ฐ์ ๊ฐ๋ฐ์๋ค์ด ์ ํด๋์ ๊ฒ์์ ์์์ ๋ฐ๊ฒ ๋ค๋ ๋๋.
2. ์๋ก์ด ๊ฐ๋
(inline)
์ ์ฐ ํ ์ข
display - inline(CATCAT ๊ธ์ ์์ ๋ง์ถฐ ๋ณ๊ฒฝ)
3. ๊ฟํ
!Doctype html : ์ง์ ์น๋ ๊ฒ์ ๊ถ์ฅ.๋จธ๋ฆฟ ์์ ๋ค์ด์์ผ ๋ ๊ฐ์น์๋ ๋ด์ฉ์ ๊ณ ๋ฏผํ ์ ์๋ ์ฌ์ ๊ฐ ์๊ธฐ๊ธฐ ๋๋ฌธ. VS์ฝ๋์๋ง ์์กดํ์ง ์๊ธฐ๋ฅผ.
์๋๋ฅผ ๊ฐ์ง๊ณ ์ฝ๋๋ฅผ ์์ฑํด์ผ ํ๋ค.
https://65708c94ac6454007029959a--gleeful-taiyaki-8bfb20.netlify.app/
๊ฐ์ธ์ ์ผ๋ก ๋นจ๊ฐ์์ ๋ฐฐ๊ฒฝ์ผ๋ก ๊น๋ ๊ฑธ ์ข์ํ์ง ์๋๋ฐ, ํฐํธ ์์์ ๋ฒ ์ด์ง๋ก ๋ฃ์ผ๋ ์ ์ด์ธ๋ฆฌ๊ฒ ๋์จ ๊ฒ ๊ฐ๋ค๋ ์๊ฐ์ด ๋ค์๋ค. ํฐํธ ์๊ฐ ๊ฐ๊ฒฉ๊น์ง ๋ฐ๊ฒฌํ์ผ๋ฉด ๋ ์ข์์ผ๋ จ๋ง, ๊ทธ๋ฌ์ง ๋ชปํ๊ณ ..
์ด ์์ ์ค ์ธ์ ๊น์๋ ๊ฑด ์ญ์ border-radius!
border-radius: top-left-x top-right-x bottom-right-x bottom-left-x / top-left-y top-right-y bottom-right-y bottom-left-y
border-radius: aa / bb
[1214 ํ ํท] CSS :: Flex ์ ๋ณตํ๊ธฐ (0) | 2023.12.14 |
---|---|
[1213 ํ ํท] (0) | 2023.12.14 |
[ํ ํท 1211] CSS (1) | 2023.12.11 |
[ํ ํท 1207] ํน๊ฐ, CSS (2) | 2023.12.08 |
[ํ ํท] 1205 (0) | 2023.12.06 |