νν μμ±
μμμ μκ°μ νν λ°©μμ μ μ΄νλ μμ±
β’
νν μμ±μ μ’
λ₯
β’
κΈ°λ³Έ μμ μ½λ
νν μμ±μ μ’ λ₯
μμ± | μ€λͺ
| μμ μ½λ |
display | μμμ λ°μ€ λͺ¨λΈμ μ€μ ν©λλ€. (block, inline, flex, grid, none λ±) | display: block; |
visibility | μμμ κ°μμ±μ μ€μ ν©λλ€. | visibility: hidden; |
opacity | μμμ ν¬λͺ
λλ₯Ό μ€μ ν©λλ€. (0μ μμ ν¬λͺ
, 1μ λΆν¬λͺ
) | opacity: 0.5; |
overflow | λμΉλ 컨ν
μΈ μ λν μ²λ¦¬μ νμ μ§μ νλ μμ± | overflow: hidden; |
κΈ°λ³Έ μμ μ½λ
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>νν μμ± μμ</title>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
text-align: center;
padding: 50px;
}
/* display μμ */
.display-block {
display: block;
background-color: lightcoral;
padding: 20px;
margin-bottom: 10px;
}
.display-inline {
display: inline;
background-color: lightblue;
padding: 20px;
}
/* visibility μμ */
.visible-example {
visibility: visible;
background-color: lightgreen;
padding: 20px;
margin: 10px;
}
.hidden-example {
visibility: hidden;
background-color: lightgray;
padding: 20px;
margin: 10px;
}
/* opacity μμ */
.opacity-full {
opacity: 1;
background-color: lightyellow;
padding: 20px;
margin: 10px;
}
.opacity-half {
opacity: 0.5;
background-color: lightpink;
padding: 20px;
margin: 10px;
}
.opacity-none {
opacity: 0;
background-color: lightblue;
padding: 20px;
margin: 10px;
}
</style>
</head>
<body>
<!-- display μμ -->
<div class="display-block">Block μμ</div>
<span class="display-inline">Inline μμ</span>
<!-- visibility μμ -->
<div class="visible-example">보μ΄λ μμ</div>
<div class="hidden-example">μ¨κ²¨μ§ μμ (κ³΅κ° μ°¨μ§)</div>
<!-- opacity μμ -->
<div class="opacity-full">λΆν¬λͺ
μμ</div>
<div class="opacity-half">λ°ν¬λͺ
μμ</div>
<div class="opacity-none">μμ ν¬λͺ
μμ (κ³΅κ° μ°¨μ§)</div>
</body>
</html>
HTML
볡μ¬