My page has space for an image that can be, say, a maximum 100x100 image. Users can upload any image dimension and the web application will resize it, maintaining aspect rat
In case someone still needs this here's a way to do it with display table;
.thumbnail { width:150px; height:150px; display: table; } .thumbnail img { max-width:150px; max-height:150px; } .thumbnailcontainer { display:table-cell; vertical-align: middle; text-align:center;}