π¨ CSS π»
CSS position
output7
2021. 12. 29. 15:23
float μμ±
- float: none β‘ float μμ±μ μ μ©μν¨ (κΈ°λ³Έκ°)
- float: left β‘ μμκ° μ»¨ν μ΄λμ μΌμͺ½μ λ°°μΉλ¨
- float: right β‘ μμκ° μ»¨ν μ΄λμ μ€λ₯Έμͺ½μ λ°°μΉλ¨
- margin: auto β‘ μμλ₯Ό μ€μμ λ°°μΉ
clear μμ±
- float μμ±μ΄ μ μ©λλ©΄ λ€μ μμκ° float μμ±μ μμ λ°λλ° μ΄κ±Έ ν΄μ μν΄
- clear: left β‘ μΌμͺ½μΌλ‘ λ°°μΉλ float μμ± μμμ ν΄μ§
- clear: right β‘ μ€λ₯Έμͺ½μΌλ‘ λ°°μΉλ float μμ± μμμ ν΄μ§
- clear: both β‘ μμͺ½μ λ°°μΉλ float μμ± μμμ ν΄μΉ (μΆμ²)
- float μμ±μ μ΄ νκ·Έμ λΆλͺ¨ μμμ ::afterλ‘ clear:both ν΄μ£Όλ©΄ λ¨
μ΄ λΆλͺ¨ νκ·Έ μμλ float μμ±μ΄ λ€μ΄κ° νκ·Έλ§ μ¬μ©νλ κ±Έ μΆμ²ν¨
position μμ±
- position: static β‘ position μμ± μμ (κΈ°λ³Έκ°)
- position: fixed β‘ μμκ° λΈλΌμ°μ μ°½μ κ³ μ λμ΄ λ°°μΉλ¨ (λΈλΌμ°μ μ°½μ΄ κΈ°μ€), μΈλΌμΈ λΈλ‘(inline-block)λ‘ λ³κ²½λ¨
- position: absolute β‘ μμκ° μ λμ μΈ μμΉμ λ°°μΉ (λΆλͺ¨ μμ κΈ°μ€), μΈλΌμΈ λΈλ‘(inline-block)λ‘ λ³κ²½λ¨
- position: relative β‘ μμκ° μλμ μΈ μμΉμ λ°°μΉ (λ΄ μλ μμΉκ° κΈ°μ€)
- μ’ν μμ±(left, right, top, bottom)μ fixed, absolute, relative μ μΈ λ κ²½μ°λ§ μ¬μ© κ°λ₯ν¨