Q1: Why replace the padding:1px with overflow:hidden to solve the margin collasping?
Q2: I think there is no overflow in the div container with class “canvas”,isn`t it?
Q3: Also,I am curious about the reason why overflow:hidden can work as padding:1px without affecting the dimension of the “canvas” when there is no overflow(If the answer of Q2 is Yes…)
Pic1(with padding:1px )
Pic2(with overflow:hidden )
Class source:
Certified Full Stack Developer Curriculum>>>The Box Model>>>Workshop Design a Rothko Paiting
Pre-thanks for your answers to my questions!!!