Okay
  Public Ticket #150204
Scaling images to a desired maximum height
Closed

Comments

  • Bannett started the conversation
    Is it possible to SCALE images to a desired maximum height? I used the following custom css code i found on another ticket: .single-portfolio #post-area img { max-height: 500px!important; display: block!important; margin: 0 auto!important; } Unfortunately, it ended up stretching my images. Is there any code you can provide that can scale the image to the limits I impose?
  •  1,077
    ThemeNectar replied

    Hey David,

    adding a maximum height like shown in the snippet you pasted should make it so the image can never pass that without stretching the image - try changing it to this though to see if it helps:

    .single-portfolio #post-area img { 
       width: auto!important;
       max-height: 500px!important; 
       display: block!important; 
       margin: 0 auto!important; 
    }

    Cheers!