Responsive image align center bootstrap 3

前端 未结 18 1138
半阙折子戏
半阙折子戏 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 15:01

    You can still work with img-responsive without impacting other images with this style class.

    You can precede this tag with the section id/ div id/class to define a order within which this img is nested. This custom img-responsive will work only in that area.

    Suppose you have a HTML area defined as:

    Then, your CSS can be:

    section#work .img-responsive{
        margin: 0 auto;
    }
    

    Note: This answer is in relation to the potential impact of altering img-responsive as a whole. Of course, center-block is the simplest solution.

提交回复
热议问题