2013-04-23 40 views
1

我正在做一些研究的紅寶石在軌道上的Web應用程序我正在工作,需要一些幫助幾個問題。砌體類型背景圖像

  1. 是否有可能使用砌體jQuery類型插件呈現/顯示圖像作爲網頁的背景?

  2. 如果第一個問題的答案是否定的,那麼是否可以使用css(3)和html(5)手動呈現多個圖像作爲背景?最後,如果我可以使用1,2或任何其他方法顯示多個背景圖像,我是否可以應用常規css代碼來操作圖像?

在此先感謝您的幫助。

回答

1

這可能與CSS3。在它的最簡單的,這裏是你將如何實現它的例子:作爲頂層到最後(右側)是底部的背景層

#exampleA { 
width: 500px; 
height: 250px; 
background-image: url(decoration.png), url(ribbon.png), url(old_paper.jpg); 
background-repeat: no-repeat; 
background-position: left top, right bottom, left top; 
} 

順序從第一次運行(左側) (這是如果你正在分層)。

編輯:爲了更復雜的花式適用於每一個背景圖像,如灰度,您需要將CSS分解成這種格式:

/* this is the master css block - the height and width here represent the total coverage for all child background images */ 
    .sample1 .sea, .sample1 .mermaid, .sample1 .fishing { 
     height: 300px; 
     width: 480px; 
     position: relative; 

    } 
/* individual stylings for each background image featured - apply greyscale and separate width and heights here */ 
    .sample1 .sea { 
     background: url(media/sea.png) repeat-x top left; 
    } 
    .sample1 .mermaid { 
     background: url(media/mermaid.svg) repeat-x bottom left; 
    } 
    .sample1 .fish { 
     background: url(media/fish.svg) no-repeat; 
     height: 70px; 
     width: 100px; 
     left: 30px; 
     top: 90px; 
     position: absolute; 
    } 
    .sample1 .fishing { 
     background: url(media/fishing.svg) no-repeat top right 10px; 
    } 
+0

謝謝你的快速反應!我試過你的建議,它的工作原理!然而,我有一個問題,我不能看到應用大小或灰度背景圖像。這是我正在使用的代碼; user2209090 2013-04-23 13:12:44

+0

我已更新我的回答以反映您的評論。 – adaam 2013-04-23 16:18:52

+0

這是天才!!!!!!!我怎麼沒有想到它?這個答案應該有數百票!這應該聽到! :d – Goowik 2018-01-04 19:01:00