[英]How do I make my navigation bar remain on top of page while scrolling?
Here is the HTML code 这是HTML代码
<div id="header" class="grid_12">
<h6>DCHOST - Brought to you by <a href="http://www.dt.co.uk" target="_blank">
DataConnectivity.co.uk
</a></h6>
<ul>
<li>Home</li>
<li>Hosting</li>
<li>Domain Names</li>
<li>Lates News</li>
<li>About us</li>
<li>Contact Us</li>
</ul>
</div> <!-- ends header grid 12 -->
CSS CSS
#header {
color: #848484;
height: 70px;
width: 100%;
font-size: small;
font-style: oblique;
text-align: center;
background: #333333;}
#header h6 {
max-height: 3px;
font-size: 10px;
text-align:left;
}
#header li {
font-weight: 800;
color: #FFFFFF;
font-style: normal;
display: inline}
I would like my nav bar to remain fixed on top of page. 我希望我的导航栏保持固定在页面顶部。 However, every time I change position to fixed, the bar completely disappears. 但是,每次我将位置更改为固定时,该条都会完全消失。 I have no idea why its doing this? 我不知道为什么要这么做? Thanks in advance for your help! 在此先感谢您的帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.