Box Model
This card is set to 320px. Why does adding padding make it overflow its container?
box-sizing: content-box;width: 320px;Content is not the whole width: The content box holds text and images; padding creates breathing room, border wraps them, and margin separates the element from its neighbors.
Layout uses the actual footprint: When elements sit side by side, the browser calculates the space they truly occupy. DevTools box-model inspection shows whether content, padding, border, or margin caused the squeeze.
You can say this to an AI Agent
Inspect the box model of these two-column cards and state the space used by content width, padding, border, and margin. Keep two columns on desktop and prevent horizontal overflow at 390px; afterward confirm the computed size in developer tools.
Select page elements for precise AI edits
Click a button, text, or card, note the change, then copy its exact location to AI.
Open Selector Pro website↗