2016-02-07 67 views
0

我正在創建引導頁面,我們有四個頁面容器部分。引導固定部件佈局問題

請在下面找到模型的屏幕, enter image description here

<div id="fixedheader"> 
<header> 
</header> 
<div class="a"> 
</div> 
</div> 
<!--Fixed header End--> 
<!--Search content part start--> 
<div class="searchcontent"> 

</div> 
<!--Search Content End--> 

我想「固定頭」部分應該是固定的我頁面的一部分。我在下面的風格,

#fixedheader 
{ 
position:fixed; 
overflow: hidden; 
left:0; 
right:0; 
} 

現在「搜索內容」部分有的在普通視圖中固定標題部分內容隱藏的,在下面找到我的樣本輸出畫面的

enter image description here

如何解決問題。

+1

能否請您發佈的代碼,這樣我可以修復它。 – pritesh

+0

@pritesh:我添加了html結構代碼 – CodeMan

回答

2

嘗試

CSS:

body{ 
    margin: 0; 
    padding: 0; 
    background: #80B196; 
} 
header{ 
    height: 150px; 
    background: yellow; 
} 
h1{ 
    margin: 0 auto; 
    padding: 50px 0 0 0; 
    width: 300px; 
    color: #333333; 
} 
ul{ 
    margin: 0; 
    padding: 0 0 0 50px; 
    list-style-type: none; 
    background: pink; 
} 
ul li{ 
    display: inline-block; 
    padding: 6px; 
    background: rgba(0,0,0,0.4); 
    vertical-align: top; 
} 
.wrapper{ 
    height: 1000px; 
} 
p{ 
    margin: 0 auto; 
    width: 60%; 
} 
.fixed-nav{ 
    width: 100%; 
    position: fixed; 
    top: 0; 
    left: 0; 
} 

和HTML

<div> 
    <header> 
    <h1>Header</h1> 
    </header> 
    <nav id="main-nav"> 
    <ul> 
     <li>div</li> 
     <li>class</li> 
    </ul> 
    </nav> 
    <span id="mine"></span> 
    <div class="wrapper"> 
    </div> 

Codepen Example

+0

+0

謝謝弗格斯。 – CodeMan

+0

我在「fixed-nav」中添加了z-index屬性 – CodeMan