2012-11-02 53 views
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; 

} 

不過,我現在需要的是將另一個圖像放在中心,這將重複下來(可滾動)並在瀏覽器重新調整大小時跟隨主體。 (圖片是here)。

當我嘗試在主體html中添加逗號的第二個圖像時,將應用第一個圖像中的「無重複中心中心固定; -webkit-background-size:cover; ....」操作在新的一個。

有沒有辦法按照我描述的方式添加另一張圖像,並保留原來的圖像?

基本上,我想用這個形象,適用於所有的包裝,身體等

我道歉,我相當的新手,我剛開始用的東西越來越熟悉。

回答

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; 

} 

如果滿足,再投給我。謝謝。

+0

非常感謝! –

+0

@Silver請投我一票。不僅謝謝你:D –