Learn HTML forms by building a registration form step 55

I am having trouble understanding what the problem is.
The question asks;
Change the margin property to include 1em on the top and bottom, and set the width as described above.
And I have this as an answer:
margin: 1em 0 1em 0;

This is incorrect and I’m not sure how to correct it. Any help here would be much appreciated.

what was original value of margin before you changed it?

It helps when you use the Ask For Help button so we can see your code and a link to the challenge.

You should still have auto, not 0

It was margin 0 auto;

margin: 1em auto;
is the correct answer but I’m not sure why, thank you for your help.

OK I think I figured it out. the 1em is for top and bottom and auto is to centre the element.
Please correct me me if I am wrong but I hope this helps anyone else who gets stuck here.

yes, that is how shorthand property is defined. if you give it one value then it hwill be applied to all top, right, bottom and left, and if you give it two values then first will be for top and bottom and second will be for left and right. Otherwise you must give four values for top right bottom left in that order

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