Margin-top not working for and tag?

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)