小编Rek*_*bhu的帖子

css背景图片适合div

可能重复:
拉伸和缩放CSS图像背景 - 仅限CSS

我想设置div背景图像div(宽度:1000,最小高度:710),图像大小是753 x 308,我试图设置它图像不适合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;
}
Run Code Online (Sandbox Code Playgroud)

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;
}
Run Code Online (Sandbox Code Playgroud)

而代码是

<div class="content"><div class="Invitation">form goes here....</div></div>
Run Code Online (Sandbox Code Playgroud)

html css background image

7
推荐指数
1
解决办法
6万
查看次数

标签 统计

background ×1

css ×1

html ×1

image ×1