이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
English
Space between boxes
- Margin is the space outside a box — the gap to its neighbours.
margin: 30px;adds 30 pixels on all four sides, outside the border.- Padding pushes the content in; margin pushes other boxes away.

English
One side at a time
- You can space just one side:
margin-top,margin-right,margin-bottom,margin-left. - The same works for padding:
padding-left: 10px;, and so on. margin-bottomunder a heading neatly separates it from the text.
English
<style>
.tag {
background-color: gold;
padding: 6px;
margin-right: 8px;
}
</style>
<span class="tag">news</span>
<span class="tag">sport</span>
English
Common mistakes
- Padding is inside the border; margin is the space outside it.
box-sizing: border-boxmakes the width include padding and border.
English
Now you try
- Margin is the gap between boxes; padding is the space inside one.
- Add margin around a box, then space below a heading.
탐색하기
margin vs padding
Padding is space inside the border; 여백 is space outside.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
Push the boxes apart from each other. Add margin: 30px; to the .box rule.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
Add space below the heading only. Add h1 { margin-bottom: 24px; }.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
Space just one side at a time. Give .quote padding-left: 16px; 및 margin-bottom: 20px;.