次のコードは、通常、.gifまたはjpg画像を使用している場合にうまく機能します。
#contentBox1{ position:relative; width:980px; background:url(../images/bg-middle.png) repeat-y; min-height:80px; }
#contentBox2{ position:relative; width:980px; background:url(../images/bg-top.png) no-repeat top; }
#contentBox3{ position:relative; width:980px; background:url(../images/bg-bottom.png) no-repeat bottom; min-height:500px; }
<div id="contentBox1"> <div id="contentBox2"> <div id="contentBox3"> Content Text Goes Here. </div> </div> </div>
しかし、ご覧のとおり、背景を見通すにはすべてが透明である必要があるため、.pngを使用します。したがって、「middle.png」の背景はヘッダーとフッターの後ろに表示されます。このdivの上部と下部にできるすべての部屋が必要ですが、これを機能させるための最適なcssコードを見つける方法がわかりません。