How to show image in proper aspect ratio by using css?

By using max-width/min-width or max-height/min-height css property you can show image in proper aspect ratio within the predefined height & width div box.

.imgClassNameMax
{
max-width : 161px;
max-height : 139px;
}

OR

.imgClassNameMin
{
min-width : 161px;
min-height : 139px;
}

Tagged , . Bookmark the permalink.

One Response to How to show image in proper aspect ratio by using css?

  1. Waleria Sawicka says:

    Congrats ~ Found your blog on Google while searching for a related topic, your site came up, it looks good, keep them coming!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>