Do I need DIV zero margin and padding?

I wonder if there is an element divin any browser with a predefined margin / padding value other than zero. As far as I know, divthey spanhave zero fill and margin values ​​according to the standard to make them a suitable canvas for decorating the style.

Even better, is there a specific standard for default styles for all elements that are cross-browsers that we can make assumptions for? For example, FORM comes with top / bottom margins, OL / UL comes with padding-left.

I sometimes see

* {
  margin: 0; 
  padding: 0;
}

and it looks like a dirty hack, not knowing the causes or consequences. Anyone have a better approach to this?

+3

Source: https://habr.com/ru/post/1744162/


All Articles