可能重复:
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。 –