Bootstrap Carousel image doesn't align properly

前端 未结 13 1395
轮回少年
轮回少年 2020-12-02 07:10

Please take a look at the following image, we are using bootstrap carousel to rotate the images. However, when the window width is large, the image doesn\'t align with the b

13条回答
  •  -上瘾入骨i
    2020-12-02 07:42

    It could have something to do with your styles. In my case, I am using a link within the parent "item" div, so I had to change my stylesheet to say the following:

    .carousel .item a > img {
      display: block;
      line-height: 1;
    }
    

    under the preexisting boostrap code:

    .carousel .item > img {
      display: block;
      line-height: 1;
    }
    

    and my image looks like:

提交回复
热议问题