Solution to the failure of the element margin top in div tag

Time:2020-6-24

Such as the title.

The problem is amazing. The parent tag of the element is div, and the attributes such as width and height have been set. However, when adjusting the element using margin, it cannot take effect. Students’ experience indicates that the parent element attribute of the element is set to

overflow:hidden;

The problem is solved.