Why can't I center an image with margin: 0 auto?
You can use margin-left: auto and margin-right: auto to center block elements on the web page. (margin: 0 auto) is a CSS shorthand.) However, is an inline element, not a block element. The solution is simple, though. Simply change the into a block element by adding "display:block" to your CSS.