<?xml version="1.0" encoding="utf-8"?>

CSS margin property

CSS margin property Bad Practice
CSS margin property Best Practice

Unlike padding, the margin is responsible for external affairs. It creates negative space outside the element's borders and prevents it from bumping into other content parts. Without margin, the design will turn into a graveyard with no fresh "air," which is negative space.

You can either select a shorthand margin property and list all values separated by spaces or use unique properties for each element's side (margin-top, margin-right, margin-bottom, and margin-left).

Improve your UX & Product skills with interactive courses that actually work