1. Understand the Box Model in depth and understand the Box Model in Depth
Box Model
1. Composition of the Box Model: margin border padding content;
2. border:
In attribute value settings, if two attribute values are given, the former indicates the upper and lower border attributes, and the latter indicates the Left and Right Border attributes. If three attribute values are given, the former indicates the upper border, in the middle, it indicates the left border, and the latter indicates the bottom border. If four attribute values are given, they are in the order of top, right, bottom, and left. When setting the background, the browser will overwrite content, padding, and border.
2. margin:
1) We need to record that the horizontal margin is the sum, and the vertical margin will cause collapse, using a large margin.
2) margin of nested boxes: The child block uses the content of the parent block as a reference.