1

我已经应用了背景图像,全屏并固定为任何分辨率:

body {

background:url('http://upload.wikimedia.org/wikipedia/commons/e/e7/Sky_with_puffy_clouds.JPG') no-repeat center center fixed;
-webkit-background-size: cover;
 -moz-background-size: cover;
 -o-background-size: cover;
 background-size: cover;

}

但是,我现在需要的是在中心放置另一个图像,如果调整浏览器大小,它将重复向下(可滚动)并跟随主体。(图片在这里)。

当我尝试在正文 html 中添加带有逗号的第二张图片时,第一张图片中的“无重复中心中心固定;-webkit-background-size:cover;....”操作将应用于新图片.

有没有办法按照我描述的方式添加另一张图片并保持原样?

基本上我想用这个图像作为一切的包装,身体等。

我很抱歉,我是新手,我刚刚开始熟悉事物。

4

1 回答 1

1

HTML:

<div class="main">
<p>I think your problem solved.
   I think your problem solved.
   I think your problem solved.
   I think your problem solved.
   I think your problem solved.
   I think your problem solved.
   I think your problem solved.
   I think your problem solved.
   I think your problem solved.
   I think your problem solved.</p>
   </div>

CSS:

body {
width:100%;
background:url('http://upload.wikimedia.org/wikipedia/commons/e/e7/Sky_with_puffy_clouds.JPG') no-repeat center center fixed;
-webkit-background-size: cover;
 -moz-background-size: cover;
 -o-background-size: cover;
 background-size: cover;

}

.main{
  margin:0 auto;
  width:960px;
  background:url('http://1.bp.blogspot.com/-fcyW3-zf_QU/UJMiLfDY44I/AAAAAAAAAIg/wA9ZVtJ3aLM/s1600/innertest.jpg') no-repeat;

}
于 2012-11-02T09:53:20.797 回答