Bootstrap Carousel image doesn't align properly

前端 未结 13 1396
轮回少年
轮回少年 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:37

    I think I have a solution:

    In your personal style sheet page, assign the width & height to match your image dimensions.

    Create an additional separate "class" on that top div that appropriates the space with spans...(Shown below)

            

    Without touching the bootstrap.css, in your own style sheet, call "carousel"(or whatever label you choose) to match the width and height of your original pix!

    .carousel       {
                width: 320px;
                height: 200px;
    

    }

    So in my case, I am using small 320x200 images to carousel with. There is probably preset dimensions in the bootstrap.css, but I don't like changing that so I can try to stay current with future releases. Hope this helps~~

提交回复
热议问题