← Trail· Lesson 3 of 9
Box model and spacing
Content, padding, border, margin, and box-sizing.
TODO i18n: Full body translation pending. Title and description are localized; the body below remains in Portuguese for now.
Todo elemento é uma caixa. De dentro para fora:
- content - o conteúdo
- padding - espaço interno
- border - borda
- margin - espaço externo
box-sizing: border-box
Com border-box, width inclui padding e border. Isso deixa layouts previsíveis. Muitos resets começam assim - veja o snippet Reset mínimo.
Pratique no exemplo Box model.