After using margin: auto ; to center the container div , I used a margin-top property at the end to create a visual space from the top . I want to know if my process is correct and if there is a better way ?
you could use a single shorthand to set all the margins at once if you want, but what you did is not incorrect )if you described it accurately)
I used margin: auto; to center the div
Then margin-top to create the top margin .
How can I use shorthand for this ? Both the margins serve different purposes .
Instead of using the one-value shorthand use one of the others, with 2 values or 3 values or 4 values depending on what you need
1 Like