助けを求めています。css で背景として設定され、div に適用される画像 (.essentials) を比例してスケーリングしようとしています。
ウィンドウを小さくすると、画像は比例してサイズが変更されますが、問題は、div までの高さが同じに保たれ、大きなギャップが残ることです。
フォールバックに modernizr を使用して、svg イメージを取得するために svg がサポートされているかどうかを検出し、IE8 以下の png 画像を取得しない場合は検出します。
以下のHTML
<div class="essentials"></div>
以下のCSS
.essentials{
margin-bottom: 5em;
height: 505px;
}
.svg .essentials{
background: url("../images/myEssentials.svg") no-repeat;
background-size: contain;
}
.no-svg .essentials{
background: url("../images/myEssentials.png") no-repeat;
}