ウェブアプリケーション内の支払いページのモーダルを作成し、支払いプロバイダのブランドを表示したい。ストライプ。モーダルウィンドウ内の画像サイズを変更する
デフォルトでは、画像は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>
の幅に応じて変更高さと幅の比率を保つようそれはあなたが最終的に自分の画像に ''クラスは=「IMG応答性」を追加しようとたページサイズの変更に非常に有用です'width =" 100% "と' height = "auto" '?さらに、このような大きな画像を使用して、インラインまたはCSSクラスを使用してスケーリングするのは悪い習慣です。最初にイメージエディタソフトウェアでイメージを縮小します。しかしこれはあなた次第です。 – Franco