NO BUG: Carousel height of 100% does not work

I have a section and a container, within that two blocks side by side. I needed an image in the right column filling the remainder of the browser width, breaking out of the container and stretching to the rightmost edge of the browser. This was successfully achieved by setting the section to position relative, image to position absolute, width 48%, height 100%, top 0, right 0. However, when attempting the same with a carousel instead of an image it did not work. It seems setting a height of 100% didn’t output the corresponding CSS, yet the width of 48% did.

In the end I worked around this issue with this custom CSS on the carousel element, but I wonder if this is a bug.

%root%, %root% .bricks-swiper-container { height: 100%; }

Note, I tried enabling adaptive height but this made the image break out of the height of the section.

Hi Jamie,
Thank you for your report!

Where exactly did you set the 100% height for the carousel? In the carousel settings themselves, or the style “ layout tab?

Percentage heights can always be problematic here and there if the wrapper has no „real" height, as x% of an unknown height cannot work. Therefore, I think this is more likely to be the problem and that you must choose other selectors, as you have already done.

Best regards,
timmse

Hi @timmse

I set the height of 100% in Carousel > Content > Settings > Height. I also tried in Style > Sizing > Height.

I understand your point about there being no explicit height defined on the parent, however setting a height of 100% should (and does with custom CSS) expand to the full height of the parent section.

It also doesn’t make sense to me that setting the height of 100% in Style > Sizing > Height doesn’t work, but custom CSS %root% { height: 100%; } does

Thanks
Jamie

Have a look at where the different settings apply to:

Carousel » Content » Settings: .image
Style » Layout: .swiper-slide
%root%: on the outermost element wrapper

This works just fine in any “basic” scenario. Your requirements are different, so you must find a custom solution - as you have already done :muscle:

So, overall, I don’t see a bug.

1 Like