Spacing Classes
Spacing classes are the most useful & quick utility classes to kick start.
Spacing system
Padding classes:
Our
padding
classes starts withp
followed by an hyphen and then the number. Number is the multiplier of 4. Sop-1
ispadding: 4px
.And you can use
pt
followed by an hyphen and the number forpadding-top
, same way,pb
ispadding-bottom
pr
ispadding-right
andpl
ispadding-left
.Along with these classes, we do have two more types of classes for padding. They are
px
andpy
.px
equals topadding-left
&padding-right
.py
equals topadding-top
&padding-bottom
. Herex
isx-axis
, which is horizontal.y
isy-axis
, which is vertical.
Margin classes:
- Same way, our margin classes starts with
m
. But we providemargin-right
andmargin-bottom
classes only. These two margin categories are enough for most of the times. This limitation is to reduce the unused css bloat.