Margin-left: auto; margin-right: auto;

	margin-left: auto;
	margin-right: auto;
	width: 100%;

Is needed when an element got width: 100%; property? Or is just with fixed value like 500px? I talk about body element currently.

To center a width?


As it’s the body you don’t really need it, if it has a container and you want it to be centered then you would use it.

1 Like