No img-responsive in Bootstrap 4

后端 未结 7 1039
北恋
北恋 2020-12-28 12:47

I just downloaded the source code for Bootstrap 4 alpha 2 and can\'t find the class img-responsive in it. It exists in Bootstrap 3 source code and I can find it

相关标签:
7条回答
  • 2020-12-28 13:26

    In Bootstrap 4 you can use class="img-fluid".

    This is the explaination:

    Images in Bootstrap are made responsive with .img-fluid. max-width: 100%; and height: >auto; are applied to the image so that it scales with the parent element.

    This is the code as suggested: <img src="..." class="img-fluid" alt="Responsive image">

    0 讨论(0)
  • 2020-12-28 13:32

    Use img-fluid class instead of img-responsive

    see docs

    0 讨论(0)
  • 2020-12-28 13:32

    You can also use .img-thumbnail that is the same of .img-fluid but also give an image a rounded 1px border appearance.

    Look the result: Image thumbnails

    0 讨论(0)
  • 2020-12-28 13:36

    Bootstrap 3: .img-responsive

    Bootstrap 4: .img-fluid

    As in Bootstrap 4 Images:

    Images in Bootstrap 4 are made responsive with .img-fluid. max-width: 100%; and height: auto; are applied to the image so that it scales with the parent element.

    <img class="img-fluid" src="" alt=""> //This will make your image responsive
    
    0 讨论(0)
  • 2020-12-28 13:45

    From the Bootstrap 4 documentation:

    Images in Bootstrap are made responsive with .img-fluid. max-width: 100%; and height: auto; are applied to the image so that it scales with the parent element.

    0 讨论(0)
  • 2020-12-28 13:50

    It seems you need to use a new class img-fluid instead of img-responsive if you are using Bootstrap 4 alpha 2. Have a look at : http://v4-alpha.getbootstrap.com/content/images/

    0 讨论(0)
提交回复
热议问题