bootstrap 4 img-fluid does not change image height

前端 未结 8 1493
情话喂你
情话喂你 2020-12-16 10:43

Responsive Images in Bootstrap 4, with class .img-fluid are resized disproportionally. They keep it\'s height even width is shrinking down correctly. That is deforming whole

相关标签:
8条回答
  • 2020-12-16 11:11

    Actually height:auto did not work for me, but height:100% worked like a champ.

    0 讨论(0)
  • 2020-12-16 11:17

    just logged in to share this super quick, and hopefully minimal changing fix

    in you style, simply set min-height to 1px or 1rem

    <head>
        ...
        <style>
        .ieFix
        {
            min-height:1px;
        }
        </style>
    </head>
    <body>
    <div class="card text-center">
        <img src="..." class="card-img-top ieFix" alt="...">
            <div class="card-body">
                <h5 class="card-title">...</h5>
                <p class="card-text">...</p>
                <p class="card-text post-meta"...</p>
            </div>
    </div>
    </body>
    

    Have confirmed this works and nothing changes on Chrome in mobile phone and tablet screens.

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