HTML- MARGINS AND OTHERS

Change the margin property to include 1em on the top and bottom, while leaving the right and left margins set to auto.

Hi, the above is the question, if i am not wrong this can be translated as

margin: 1 2 3 4;

with right-margin=1 , left-margin =2, top-margin=3,right-margin=4.
i would imagine in the case where the code is written

margin: 1px auto;

the 1px here, would represent left and right with top and bottom being represented by ‘auto’. why then is it being represented the other way round with px being top and bottom, and top and down being auto.

The values for the shorthand goes clockwise, top > right > bottom > left. Or top/bottom and left/right with two values.

1 Like

thank you for the help

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