The sub-element's margin-top acts on the outer parent element. Solution: margin-top outer layer
The sub-element's margin-top acts on the outer parent element. solution:
Sometimes, when setting the margin-top attribute of a child element, it is intended to act on the parent element, but the result is that the parent element has the margin-top effect, the following describes how to solve this problem through code examples.
The code example is as follows:
<! DOCTYPE html>
The above Code meets our requirements. In fact, this is a typical problem of outer margin merging. You can add overflow: hidden to eliminate this phenomenon. We will not discuss it here, for details, refer to the detailed description of margin merging in margin.
The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 12696.
For more information, see: http://www.softwhy.com/divcss/