One centred image on an html page

Arsa Persian

New Member
I am trying to write an html page that I can put any image url into, and it displays that image with a black background, centred vertically and horizontally on the page.I have this:\[code\]<html><body style="background: black;"><img src="http://i.imgur.com/n8o1E.png" style="display: block; margin: auto; max-height: 100%; max-width: 100%"></body></html>\[/code\]Which does the job right for images that are taller and thinner than the page, but it doesn't centre things vertically. How can I do this?
 
Back
Top