1
背景画像を表示するにはdivの高さを動的に調整する必要があります。私はこの仕事を得るために努力していますので、私はdivを上にマウスを置いて背景を拡大すると、そのCSSのトリックを変えることができますが、私の画像は様々なサイズになります。どんな助けもありがたいです...私は立ち往生しました!背景画像に基づいてdivを整える
CSS:
<style>
.dynaimage{
width:80%;
background-image:url('variable-image');
background-size:100%; margin:0 auto;
}
</style>
HTML:
<div class="dynaimage"></div>
<p>The above div should take the height of its background image</p>
です! Thnx! –