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

CSS padding shorthand property

CSS padding shorthand property Bad Practice
CSS padding shorthand property Best Practice

Like margin, we can only set one, two, or three padding values and call it a day. Consider the following:

  • If you specify one value, it applies to all four sides
  • If you specify two values, they apply to the top and bottom and left and right, respectively.
  • If you specify three values, the first one applies to the top, the second to the right and left, the third to the bottom
Improve your UX & Product skills with interactive courses that actually work