Okay
  Public Ticket #3650780
Fixed Height Gallery
Closed

Comments

  • joaoduartemorgado started the conversation

    Hi. I have a Side Portfolio Post where i want to add a gallery with one image slider. This image slider is set to have 1/2 width, but i want to fix the height of this element, so it does not messes up with the rest of the page. Is it possible to make it with fixed height and the images inside adapt to that maximum height?

    Thanks a lot.

  •  1,558
    Laborator replied

    Hi there,

    That's not possible by theme options but I can give it a try if I can achieve it somehow. 

    Please share your website login credentials so I can test this. To safely include your credentials click the Insert Credentials button in the editor toolbar (see how), or you can create a temporary login without a password (see how).


    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  • joaoduartemorgado replied

    I have tried adding this to Additional CSS customization:
    It works, but the vertical images are left allgned. 

    http://joaomorgado.com.pt/portfolio/casa-vilarinha/

    .portfolio-images-slider {
        width: 365px; /* Fixed width */
        height: 365px; /* Fixed height */
        display: flex; /* Use flexbox */
        justify-content: center; /* Center horizontally */
        align-items: center; /* Center vertically */
        background-color: #eeeeee; /* Add a background color to the slider container */
        overflow: hidden; /* Hide overflow content */
        position: relative; /* Ensure proper positioning */
    }

    .portfolio-images-slider .image-slide {
        display: flex; /* Use flexbox */
        justify-content: center; /* Center horizontally */
        align-items: center; /* Center vertically */
        height: 100%; /* Full height of the parent container */
        width: 100%; /* Full width of the parent container */
        background-color: #eeeeee; /* Add a background color to each image slide */
    }

    .portfolio-images-slider .image-slide a {
        display: flex; /* Use flexbox */
        justify-content: center; /* Center horizontally */
        align-items: center; /* Center vertically */
        height: 100%; /* Full height of the parent container */
        width: 100%; /* Full width of the parent container */
    }

    .portfolio-images-slider .image-slide img {
        height: 100%; /* Max height of the image */
        width: auto; /* Maintain aspect ratio */
        max-height: 365px; /* Ensure image fits within the container */
        max-width: 365px; /* Ensure image fits within the container */
        object-fit: contain; /* Ensure the entire image fits within the container */
    }

  •  1,558
    Laborator replied

    Hi there,

    Can you try adding the following CSS to Custom CSS:

    .portfolio-images-slider .image-slide img {
        margin: 0 auto !important;
        width: -webkit-fill-available;
    }
    

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  • joaoduartemorgado replied

    Wow! It works like a charm! Brilliant! Thank you so so much!

  •  1,558
    Laborator replied

    You're welcomesmile.png

    If you have a spare moment, I kindly request that you consider sharing your positive experience with us on G2. Your review would not only make our day but also help other potential customers to make an informed decision about choosing our theme for their needs.

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group