Responsive image align center bootstrap 3

前端 未结 18 1172
半阙折子戏
半阙折子戏 2020-11-29 14:16

I do a catalog using Bootstrap 3. When displayed on tablets, the product images look ugly because of their small size (500x500) and a width of 767 pixels in the browser. I w

18条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-29 14:53

    You can use property of d-block here or you can use a parent div with property 'text-center' in bootstrap or 'text-align: center' in css.

    Image by default is displayed as inline-block, you need to display it as block in order to center it with .mx-auto. This can be done with built-in .d-block:

    Or leave it as inline-block and wrapped it in a div with .text-center:

提交回复
热议问题