Why does increasing the margin make it go down diagonally to the right?

I am trying to design for mobile first and so haven’t started on the desktop yet.

I want to move the div container straight down to center it both horizontally and vertically, but when I increase the margin of the div container it moves diagonally down to the right. Why?

You’re using margin which applies margin to all four sides. You want to use margin-top to move it straight down.

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