css - 在模态窗口内调整图像大小

标签 css twitter-bootstrap laravel bootstrap-modal

我在我的 Web 应用程序中为支付页面创建了一个模式,并希望显示支付提供商的品牌;条纹。

默认情况下,图像为 1950x927。我可以使用 style 手动更改它但是,这并不能使图像大小真正动态化;即它在桌面上可能看起来不错,但仍然延伸到移动设备上的模态。

桌面:

Stripe image - desktop

移动的:

Stripe image - mobile

如何使用模态响应加载图像大小?

以下是我页面上的代码:

<!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">How can you know your payment is secure?</h4>
      </div>
      <div class="modal-body">
        <img src="{{ asset('img/stripe.png') }}" style="height:250px;">
        <p>Stripe has been audited by a PCI-certified auditor and is certified to <a href="http://www.visa.com/splisting/searchGrsp.do?companyNameCriteria=stripe" target="_blank">PCI Service Provider Level 1</a>. This is the most stringent level of certification available in the payments industry. To accomplish this, they make use of best-in-class security tools and practices to maintain a high level of security at Stripe.</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>

最佳答案

Images in Bootstrap 3 can be made responsive-friendly via the addition of the .img-responsive class.



欲了解更多信息,您可以阅读 here

尝试这个:
<img class="img-responsive" src="{{ asset('img/stripe.png') }}" style="max-height:250px;">

关于css - 在模态窗口内调整图像大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39850568/

相关文章:

html - 图片库(带有顶部两条水平线的图片/视频缩略图)

php - laravel Redirect::to() 丢失端口

css - 如何将滚动条添加到数据表?

javascript - 如何使用 Javascript/jQuery 根据浏览器的窗口大小动态设置 CSS 类的高度?

jquery - 为来自 jQuery 的伪元素应用 CSS 样式

jquery - 垂直轮播在大屏幕上有多个元素,但在移动 View 中带有默认 Bootstrap 的单个图像

jquery - Bootstrap 轮播而不使用左类(或范围)

javascript - Bootstrap 模式无法正确加载

php - Laravel 查找或失败尝试获取非对象的属性

php - Laravel 迁移不会在数据库中添加表