This div has a width of 500px and margin set to auto.

This div has a max-width of 500px and margin set to auto.

Resize the browser window to less than 500px wide to see the difference.