簡體   English   中英

無法將圖像疊加在另一個圖像上

[英]Can't overlay an image over another

我正在尋找幫助。 我已經建立了一個網站,希望在該網站上有圖案的背景圖像(可以正常工作),但是我想在背景圖像的頂部有一個邊框圖像。

我試過使用position:absolute,並在每個元素上設置z-index,但是每次它將背景圖像切成兩半並且完全不重疊時。

救命!

這是我到目前為止的代碼。 我是編碼新手,請原諒任何可憐的代碼!

body {
color:#787371;
background:url(images/line-top.png) repeat-x top;
position: absolute; 
z-index: 1;
}

#bodychild {
background:url(images/bg-body.jpg);
border:0;
position: absolute;
z-index: 10;
}

使用多個背景:

body {
background: 
url(http://subtlepatterns.com/patterns/dark_fish_skin.png) center top repeat-x,
url(http://subtlepatterns.com/patterns/food.png) center top repeat;
}

更多信息: http : //css-tricks.com/stacking-order-of-multiple-backgrounds/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM