Bootstrap Carousel image doesn't align properly

前端 未结 13 1420
轮回少年
轮回少年 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条回答
  •  不知归路
    2020-12-02 07:52

    I faced the same problem and solved it this way: It's possible to insert non-image content to Carousel, so we can use it. You should first insert div.inner-item (where you will make center alignment), and then insert image inside this div.

    Here is my code (Ruby):

    
    

    And my css-code(.scss):

    .inner-item {
        text-align: center;
        img {
            margin: 0 auto;
        }
    }
    

提交回复
热议问题