Paula
Paula

Reputation: 31

slick.js carousel dosen't work at height percent

I use slick.js carousel and I simplify css a little bit to fix that error but I think the problem is from javascript.

If I add to .slick-slide height in pixels, works. But if I want to use percentage, slider get auto-height. Form where, I really don't know. I try to put height: 100% !important; add classes with height, remove, but nothing work.

Here is CodePen exemple

Upvotes: 2

Views: 1163

Answers (1)

gopalraju
gopalraju

Reputation: 2309

For height to work in percentages, you need to set height for all parent divs. Check this out: http://codepen.io/anon/pen/LVjadW

html, body, #myCarousel, #myCarousel div{
  height:100%;
}

#myCarousel .slick-slide {
    height: 50%;
    float: left;
}

Upvotes: 1

Related Questions