Cascading Style Sheets Knowledge Base

Centering Images[1]

It may be necessary to set width.

Also, an image cannot be centered if the width is set to 100% (full-width).

img.center { display: block; margin-left: auto; margin-right: auto; }