可能重複:
Stretch and Scale a CSS image Background - With CSS onlyCSS背景圖像擬合到的div
我想設置的div背景圖像的div(寬度:1000,最小高度:710)和圖像尺寸是753 x 308 whan我試圖設置它圖像不適合div大小我應該怎麼做?
.Invitation {
background-color: transparent;
background-image: url('../images/form.png');
background-repeat: no-repeat;
background-position: left top;
background-attachment: scroll;
background-size: 100%;
width: 1000px;
height: 710px;
margin-left: 43px;
}
的DIV類是
.content {
clear:both;
width:1000px;
background:#e7e8e9;
background-image:url('../images/content.jpg');
background-repeat:no-repeat;
background-position:left top;
min-height:710px;
}
而且代碼
<div class="content"><div class="Invitation">form goes here....</div></div>
您是否想要縮放背景圖像以適應(比例)或拉伸(扭曲)到DIV? – rcdmk
圖像應該覆蓋div。 –