vendredi 31 juillet 2015

CSS align fullscreen image with max-height to middle

I am trying to create a simple gallery-like image viewer and I want to align the image to the centre and middle of the page.

This can be done simply using table and table-row, but only in the case when the image is smaller than 100% of the page. In the second case, I am able to align it simply through text-align: centre and max-height: 100% (see http://ift.tt/1IdvMgy).

But how to get it working in both cases?

Aucun commentaire:

Enregistrer un commentaire