There is a place for an image on my page, which can be, say, a maximum image of 100x100. Users can upload any image dimension, and the web application will resize it, supporting an aspect ration, up to 100x100. Thus, it is possible to resize images to, for example, 75x100 or 100x75, etc.
Regardless of the size of the resized, I want it to be displayed vertically and horizontally in the center in the selected space on the web page. How to do it in CSS? Do I need to contain a div, for example:
<div class="image_container">
<image src="http://placehold.it/100x100/" height="100" width="100" alt=""/>
</div>
In any case, a CSS example will be helpful. Thank!
source
share