任何人都可以告訴我這種效果是如何創建的嗎?一個頁面上有多個Z-index元素
從而使標題欄和形象留靜態的,但是當你向下滾動網頁上的內容區域重疊的圖像,但沒有頭。
我認爲也許標題和bg圖像和內容區域都有不同的z-index,但我似乎不能複製這種效果。
下面是我一直與玩弄本地:
<style type="text/css">
body{
margin:0px;
padding:0px;
}
#head{
width:2000px;
height:180px;
background-color:#666;
position: fixed;
z-index: 10000;
}
#image{
width:2000px;
height:500px;
background-color:#F00;
}
#content{
width:2000px;
height:1000px;
background-color:#090;
}
</style>
<div id="head">HEAD</div>
<div id="image">IMAGE</div>
<div id="content">CONTENT</div>
'inspect element'並試一試 –
是它的視差設計? – Arun
它被稱爲視差設計 –