Home Forums WordPress Themes WhiteBlack WP Theme Flexslider Portrait Landscape Image Sizing

Flexslider Portrait Landscape Image Sizing

  • Author
  • #5211



    I’m using the flexslider image gallery in my posts. And I have both portrait and landscape photos to insert into the gallery. I noticed that the portrait photos automatically get stretched to fit the container. So to preserve the image aspect ratio I changed the following CSS:

    .flexslider .slides img{
    width:auto !important;
    margin: 0 auto !important;

    However, on a mobile device, the images fail to scale responsively and gets cut off. Is there any way to modify the CSS so that the flexslider container itself doesn’t just scale responsively in the horizontal direction but also in the vertical direction? And to have the images within scale proportionally and responsively as well?

    Thank you so much for your help!!

    You must be logged in to view attached files.



    try use max-width: 100%; and do not use width: auto; because it makes image with original width.
    You can check w3school article about it: http://www.w3schools.com/css/css_rwd_images.asp.

    regards, Marcin


    This reply has been marked as private.

You must be logged in to reply to this topic. Click here to login or register