First post for me here.
I'm using a div to crop thumbnail images all in the same proportions (180wx170h). I'm getting stuck when dealing with portrait as well as landscape images. If am using this which is fine for portrait style images:
.crop img {max-height:170px; width:auto}
.. and is fine for landscape style images:
.crop img {max-width:180px; height: auto;} is fine for landscape style images.
So I basically want to crop the sides if landscape and top/bottom if portrait. Kind of like a prioritized max-height and max-width.
I know this could be done easily with PHP but I really only know CSS so that would be my first preference.
I need to maintain the aspect ratio of the image.
max-height
andmax-width
in the same declaration. – alexvance