Make bootstrap carousel responsive on height

后端 未结 7 1657
夕颜
夕颜 2021-02-05 14:51

I need to customize BS carousel, to make images size responsive corectly. I need the carousel to adapt to the height of the active slides images initiel height. When the viewpor

相关标签:
7条回答
  • 2021-02-05 15:45

    I had the same problem adding the class "img-responsive" in the image tags made images responsive

                <div class="carousel-inner">
                <div class="item active">
                    <img src="/imahes/my-image.jpg" alt="1" class="img-responsive" />
                    <div class="carousel-caption">
                         <h4 class="text-left">My caption</h4>
    
                    </div>
                </div>
    

    but the problem was with the slider height so I need to add a media query to resize the control div

    @media (max-width: 800px) {
    .carousel-control{
      height:350px;
    }
    }
    

    this media query is just an example, customize it to suit your needs, I hope that will help

    0 讨论(0)
提交回复
热议问题