Padding is the whitespace between an element’s content and its border. The padding shorthand property sets padding values in one declaration instead of writing padding-top, padding-right, padding-bottom, and padding-left separately. section 9.1 section 9.7
Use padding to give content room to breathe:
- Choose standard CSS units such as px, em, rem, vw, vh, or percentages. section 9.3
- Write individual side declarations when each side needs a distinct value. section 9.3
- Replace repeated side declarations with one padding shorthand declaration. section 9.3 section 9.7
- Add horizontal padding to navigation items so labels do not run together. section 9.3
A pull quote with four padding values
Write the four side values in one declaration: .pullquote { padding: 1em 1.5em .75em 1.25em; } This duplicates separate top, right, bottom, and left declarations while keeping the rule compact. section 9.3
Figure 9.4 The syntaxes of the padding shorthand property
View the syntax patterns for the padding shorthand property. section 9.3


















