Padding can be used in two ways:
Padding: 0px; indicates that all data is filled with 0px;
Padding-left: 10px; 10px on the left; similarly, padding-right, top, bottom;
Padding: 10px 20px 30px 40px; this is interesting: his order is top right bottom left ....
IE 6, IE 7, and Firefox have different interpretations of this, but they are different in html4.0 and XHTML 1.1. So be careful when using padding. I thought that his IE7 and Firefox should be included in width and height. There is also border.
In contrast, margin needs to be rigid and does not need to be deliberately calculated. As long as the distance is left, the distance is above... A certain distance does not affect width and height.
The usage is exactly the same as that of padding. In xhml1. The explanation in 1 is different from that in html4.0. For example
Mainpanel {
Margin: auto;
}
In 4.0, this layer is directed to the left, and in xhml 1.1, this layer is directed to the center. This is also a method that I have always used to center the layer...
Sometimes some layers cannot achieve the desired effect. You may consider clear: Both; this is to clear float.