Title: Fixed height, dynamic width
Last modified: February 9, 2022

---

# Fixed height, dynamic width

 *  Resolved [Manuel](https://wordpress.org/support/users/jokermanu/)
 * (@jokermanu)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fixed-height-dynamic-width/)
 * first of all i want to say that
    it’s a great plugin – great work! Is there a
   way to display the individual slides (that should be images) in a fixed height
   but with a dynamic width? [Heres an example](https://hartmutwalz.de/#aktuelles)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Virgildia](https://wordpress.org/support/users/virgildia/)
 * (@virgildia)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fixed-height-dynamic-width/#post-15345158)
 * Hello [@jokermanu](https://wordpress.org/support/users/jokermanu/) ! I’m happy
   that you found the plugin useful. You can create fixed heights with custom CSS.
   There is no option for dynamic widths however I will add the feature for possible
   implementation in a future version. At this moment the carousel uses minimal 
   styling, giving developers all the control. Custom CSS is required for layouts
   with fixed heights.
 *  Thread Starter [Manuel](https://wordpress.org/support/users/jokermanu/)
 * (@jokermanu)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fixed-height-dynamic-width/#post-15345183)
 * Thank you for your prompt reply.
    Could you provide some CSS to achieve this 
   layout?
 *  Plugin Author [Virgildia](https://wordpress.org/support/users/virgildia/)
 * (@virgildia)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fixed-height-dynamic-width/#post-15345549)
 * [@jokermanu](https://wordpress.org/support/users/jokermanu/) i would need a link
   to your website to see the carousel.
 *  Thread Starter [Manuel](https://wordpress.org/support/users/jokermanu/)
 * (@jokermanu)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fixed-height-dynamic-width/#post-15345661)
 * Sorry, [here’s the link](https://swj.wp8-demo.de/slider/). It’s an test environment.
 * Thanks a lot in advance
 *  Plugin Author [Virgildia](https://wordpress.org/support/users/virgildia/)
 * (@virgildia)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fixed-height-dynamic-width/#post-15345832)
 * [@jokermanu](https://wordpress.org/support/users/jokermanu/) try adding this 
   to your custom CSS (at the end of all stylesheets)
 *     ```
       .wp-block-cb-carousel .slick-track {
         display: flex;
       }
   
       .wp-block-cb-carousel .wp-block-cb-slide {
         height: auto;
       }
   
       .wp-block-cb-carousel .gb-container, .wp-block-cb-carousel .gb-inside-container {
         height: 100%;
       }
   
       .wp-block-cb-carousel .wp-block-image {
         position: relative;
         overflow: hidden;
       }
   
       .wp-block-cb-carousel .wp-block-image:before {
         content: "";
         display: block;
         padding-bottom: 100%;
       }
   
       .wp-block-cb-carousel .wp-block-image img {
         height: 100%;
         object-fit: cover;
         object-position: center;
         position: absolute;
         top: 0;
       }
       ```
   
 * It will set all the slides to same height (based on the tallest slide). It also
   sets all the images to the same height but may cause some cropping so make sure
   you’re using proper image sizes. If you want to change the height of images just
   adjust `padding-bottom: 100%;` in `.wp-block-cb-carousel .wp-block-image:before{...}`.
   You can go above 100% if you want the images to be higher.
 * Just a note, the first two selectors will set all the slides to be the same height:
 *     ```
       .wp-block-cb-carousel .slick-track {
         display: flex;
       }
   
       .wp-block-cb-carousel .wp-block-cb-slide {
         height: auto;
       }
       ```
   
 * For any inner slide blocks, use height 100% to expand and custom CSS. Each block
   will need different CSS to expand.
 * The CSS that I provided is based on the blocks that you have now in the slides.
   Of course if you change the blocks/html the CSS might not work. For this reason
   it is up to the developer to use custom CSS. it will be different for each block.
    -  This reply was modified 4 years, 1 month ago by [Virgildia](https://wordpress.org/support/users/virgildia/).
    -  This reply was modified 4 years, 1 month ago by [Virgildia](https://wordpress.org/support/users/virgildia/).
    -  This reply was modified 4 years, 1 month ago by [Virgildia](https://wordpress.org/support/users/virgildia/).
    -  This reply was modified 4 years, 1 month ago by [Virgildia](https://wordpress.org/support/users/virgildia/).
 *  Thread Starter [Manuel](https://wordpress.org/support/users/jokermanu/)
 * (@jokermanu)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fixed-height-dynamic-width/#post-15345911)
 * Wow, what a great and fast support.
    Tanks a lot, worked great!
 *  Plugin Author [Virgildia](https://wordpress.org/support/users/virgildia/)
 * (@virgildia)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fixed-height-dynamic-width/#post-15345922)
 * [@jokermanu](https://wordpress.org/support/users/jokermanu/) great! If you are
   happy with plugin please feel free to leave a rating/review 🙂 All the best!
    -  This reply was modified 4 years, 1 month ago by [Virgildia](https://wordpress.org/support/users/virgildia/).
 *  Thread Starter [Manuel](https://wordpress.org/support/users/jokermanu/)
 * (@jokermanu)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fixed-height-dynamic-width/#post-15345935)
 * Already done😀

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Fixed height, dynamic width’ is closed to new replies.

 * ![](https://ps.w.org/carousel-block/assets/icon.svg?rev=2024115)
 * [Carousel Slider Block for Gutenberg](https://wordpress.org/plugins/carousel-block/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/carousel-block/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/carousel-block/)
 * [Active Topics](https://wordpress.org/support/plugin/carousel-block/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/carousel-block/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/carousel-block/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Manuel](https://wordpress.org/support/users/jokermanu/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/fixed-height-dynamic-width/#post-15345935)
 * Status: resolved