Til :: overflow:hidden π display:none
overflow:hidden π display:none
λ νκ·Έ λ€ μ¬μ©ν΄λ³Έμ μ΄ μλλ° μμλ€μ 보μ΄μ§ μκΈ° μν΄ μ¬μ©νμ§λ§ κ·Έ μ°¨μ΄μ λν΄ κΉκ² μμλ³Έμ μ΄ μμ΄ μ΄λ²μ μμλ³΄κ³ μ νλ€.
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<style>
p{
margin: 0;
}
section {
width: 150px;
height: 150px;
background-color: #EEA47F;
margin: 50px;
}
p {
font-size: 18px;
color: #00539C;
}
</style>
</head>
<body>
<section class="sec1">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem eligendi ipsam unde minus quae quod maiores quas
in enim quos animi totam provident quisquam doloremque, sunt sed, vitae amet consequatur!</p>
</section>
</body>
</html>
μ΄λ κ² μμκ³Ό μ½ν μΈ κ° μμλ μμ λ°κΉ₯μΌλ‘ κΈμκ° λμ¨κ²μ νμΈν μ μλ€.
overflow
μ ν΄μ§ λΈλ‘λ³΄λ€ κ·Έ μμ μ½ν μΈ κ° λ ν΄ λ μ§μ νλ μ²λ¦¬λ²μ΄λ€.
μ μ© κ°λ₯ν λ°©λ²μ visible, hidden, scroll, autoκ° μλ€.
overflow μμ±μ΄ ν¨λ ₯μ κ°κΈ° μν΄μ λ°λμ λΈλ‘ λ 벨 컨ν μ΄λμ λμ΄(height λλ max-height)λ₯Ό μ€μ νκ±°λ, white-spaceλ₯Ό nowrapμΌλ‘ μ€μ ν΄μΌνλ€.
μμ λ°κΉ₯μΌλ‘ κΈμκ° λ μμ§λ§ μ€ν¬λ‘€λ°λ₯Ό λ§λ€μ΄ μ£Όμ§μκ³ μμλ§νΌλ§ 보μ¬μ€λ€.
display
display μμ±μ λ°μ€μ μ±μ§μ μ§μ νμ¬ λ€λ₯Έ λ°μ€λ€κ³Ό μ΄λ€ λ°©μμΌλ‘ μμΉκ° λ°°μΉ λ μ§ κ²°μ νλ€.
ν¬κ² μΈλΆμ λ€λ₯Έ νμ , λΆλͺ¨ λ°μ€λ€κ³Όμ λ°°μΉμ μν₯μ λ―ΈμΉλ μΈλΆ λμ€νλ μ΄ νμ κ³Ό, λ΄λΆ μμ λ°μ€λ€μ λ°°μΉμ μν₯μ λ―ΈμΉλ λ΄λΆ λμ€νλ μ΄ νμ μΌλ‘ ν¬κ² λλ μ μλ€.
μ΄λ κ² λμΌν μμ λ κ°κ° μμ λ μΌμͺ½μλ§ display: none;μ μ£Όμμ λμ λ³νλ μλμ κ°λ€.
display:none;μ μ€ μμμ΄ μμ μ¬λΌμ§κ³ μ€λ₯Έμͺ½μ μλ μμμ΄ μΌμͺ½μΌλ‘ λ°λ¦°κ²μ νμΈν μ μλ€.
overflow: hidden;κ³Ό display: none;μ μ°¨μ΄μ
overflow: hidden;μ λ μ΄μμμ μν₯μ μ£Όμ§ μκ³ μμλ΄μ μ½ν μΈ λ§ λ³΄μ¬μ€λ€.
display: none; ν΄λΉ μμ±μ μ μ©ν λΈλ‘μ μ¨κ²¨ μ νμλ κ²μ²λΌ 보μ¬μ§λ€.