Removing body margin in CSS

I would say that using this global reset is a bad way of solving this.

* {
  margin: 0;
  padding: 0;
}

The reason for the h1 margin popping out of the parent is that the parent does not have a padding.

If you add a padding to the parent element of the h1, the margin will be inside the parent.

Resetting all paddings and margins to 0 can cause a lot of side effects. Then it’s better to remove margin-top for this specific headline.

Leave a Comment

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