This issue is known as Margin Collapse and happens sometimes between top
and bottom
margins on block elements.
The margins of adjacent siblings are collapsed
That's why the margin doesn't work on the p
tag. To make it work here an option is to use padding-top
on the p tag.
And on the a
tag the margin doesn't work because it's an inline element. You may need to change its display
property to inline-block
or block
.