【发布时间】:2017-02-12 12:25:05
【问题描述】:
我在我的网络应用程序中为支付页面创建了一个模式,并希望显示支付提供商的品牌;条纹。
默认情况下,图像为 1950x927。我可以使用style 手动更改它,但这不会使图像大小真正动态;即它在桌面上可能看起来不错,但在移动设备上仍然可以扩展。
桌面:
手机:
如何让图像大小通过模态响应加载?
下面是我页面上的代码:
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</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>
【问题讨论】:
-
您是否尝试将
class="img-responsive"添加到您的图像中并最终添加width="100%"和height="auto"?此外,使用如此大的图像然后内联或使用 css 类对其进行缩放是不好的做法。您应该首先使用图像编辑器软件调整图像大小。但这取决于你。
标签: css twitter-bootstrap laravel bootstrap-modal