louis
louis

Reputation: 3

Fit images to container size keeping aspect ratio

I can't find a way to display the thumbnails on this page as fitting into boxes of same dimensions (height:122px and width: 178px) without changing their respective aspect ratio. I don't know the thumbnails original dimensions. I have several nested divs as you can see, and the one that is of class .picture1 has those dimensions, but the images do not fit into this div. Can you help me ?

Thanks

Upvotes: 0

Views: 3680

Answers (1)

Vivek Dragon
Vivek Dragon

Reputation: 2248

IS this really a problem. After checking your page its quite simple that if you add the below class the images fit inside the comtainer

    .work-view img {
      max-height: 100px;
      padding: 5px 5px 2px;
      max-width: 150px;}

enter image description here

Upvotes: 7

Related Questions