Search

ν‘œν˜„ 속성

ν‘œν˜„ 속성

μš”μ†Œμ˜ μ‹œκ°μ  ν‘œν˜„ 방식을 μ œμ–΄ν•˜λŠ” 속성
β€’
ν‘œν˜„ μ†μ„±μ˜ μ’…λ₯˜
β€’
κΈ°λ³Έ μ˜ˆμ‹œ μ½”λ“œ

ν‘œν˜„ μ†μ„±μ˜ μ’…λ₯˜

속성
μ„€λͺ…
μ˜ˆμ‹œ μ½”λ“œ
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
볡사
μŠ€νƒ€μΌ 속성
μŠ€νƒ€μΌ 속성