Doubt in Learn the CSS box model by building Rokhoto painting [Beta]

Why margin added to ‘one’ div pushes past the canvas and onto the frame’s border, shifting the entire canvas down 20 pixels.

and why we need to add padding of 1px to fix that ?

Are you asking for the logic behind this:

Before the modification:

After the modification:

We are applying margin to ‘one’ div,then why canvas is pushed.

And why adding 1 px padding fixes it.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.