Cannot set top and bottom margin

link to code

cannot set top and bottom margin for #showallworkbtn

a element (anchor tag) is an inline element by default. And top/bottom margins don’t work on inline elements.

Make it display: inline-block; and the margins would work normally.

You can google the differences between
display: inline-block;
display: block;
display: inline;

1 Like