2013-04-23 82 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