When we recommend creating a style for an HTML page, we first add the following CSS style to set all of the elements inside and outside the space to 0:
{
margin:0px;
padding:0px;
}
Because if we don't explicitly define, because different browser processing policy is different, some default spacing is set to 0, while some have default values. This can result in differences that are displayed in different browsers.
Example
Removes the default outer-margin margin and interior margins for HTML tags padding
Body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,<br>legend,input,textarea,p, Blockquote,th,td,hr,button,article,aside,<br>details,figcaption,figure,footer,header,hgroup,menu,nav, Section {
margin:0;
padding:0;
}
padding: Up, right, down, left; {Rotate clockwise from top}
Available Padding-top, Padding-bottom, Padding-left, Padding-right, respectively:
If the Padding property is missing right, bottom, left; All refer to Top:
If the padding attribute is missing bottom, left; Bottom will refer to top and left will refer to right:
If the Padding property is missing left; Left will refer to right:
The outer margin margin and the inner margin padding the same reason: