The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Centering an Item Re: [Solved] Centering an Item


margin: 0 auto;

is the same as:

margin: 0 auto 0 auto;

is the same as:

margin-top: 0;
margin-bottom: 0;
margin-left: auto;
margin-right: auto;

What it’s saying is, making the top and bottom margin zero (or whatever number you like, it has no change on it being centered). And then for the left and right margins, automatically even them out, depending on what size window the user has.