note: I know first behavior is related to margin collapse but I still can't explain why the jumping up and down behavior of the top left pink menu happens on mouse click. Details below.
I was following a course. Here is project link and here demo.
Page looks like this:
Now after we make a single change in CSS from above link namely comment padding:
.container {
background-color: #fafafa;
transform-origin: top left;
transition: transform 0.5s linear;
width: 100vw;
min-height: 100vh;
/* padding: 50px; */
}
Two things start to happen:
container is shifted down, isn't that business of margin?- Notice how the top left pink fixed menu starts to jump vertically up and down when you click to open and close the menu.
Ok first behavior was suggested to me to be because of margin collapse, now second behavior is also probably due to margin collapse, but I can't explain still why that kind of behavior happens: namely that the top left pink menu starts to jump up and down on open/close click?