2013-12-18 49 views
0

這裏是例子。固定標題在水平parralax響應網站

http://www.poste-ton-look.com/OneMuze/index.html

我儘量保持頭在這個例子中,頁腳顯示。全寬度,固定頂部位置。

問題是,我使這個網站響應水平導航:如果我horizo​​ntaly滾動,標題結束。如果我嘗試在固定/絕對頂部位置顯示標題,它會殺死它。

目標是在全寬度頂部中心位置保持標題響應調整。

感謝您的幫助,

對不起,我的英語。

Seb。

回答

0

這是我將如何繼續得到你的目標是:

FIDDLE

HTML:

<header></header> 
<section> 
    <span>bla</span> 
    <span>bli</span> 
    <span>blu</span> 
    ... 
</section> 
<footer></footer> 

CSS:

*{ 
    margin:0; 
    padding:0; 
} 

html,body{ 
    height:100%; 
    width:100%; 
} 


header,footer{ 
    position:fixed; 
    left:0; 
    width:100%; 
    height:50px 
} 
header{ 
    top:0; 
    background:red; 
} 
section{ 
    height:100%; 
    width:4000px; 
    background:green; 

} 
span{ 
    position:relative; 
    top:100px; 
    margin:100px; 
} 
footer{ 
    bottom:0; 
    background:yellow; 
} 
+0

感謝。我管理了我的頭文件組件的z-index屬性,它爲我工作。 –