我正在研究具有固定標題的HTML代碼。它工作得很好,直到我刷新頁面,它下降到當前部分。我嘗試了很多方法,但無法弄清楚問題所在。有沒有人有這個解決方案?當頁面刷新時,HTML固定標題正在改變位置
.subMenu {
\t position:fixed;
\t top:163px;
\t height: 50px;
\t z-index: 2000;
\t width: 100%;
\t border-top: 1px solid #C7E603;
\t background: url(../images/nav-bg.png) repeat-x #80B404;
\t box-shadow: 0px 1px 5px #1F1E20;
}
.subMenu .inner {
\t padding: 0;
\t font-weight: 400;
}
.subNavBtn {
\t display: block;
\t height: 35px;
\t width: 9.48%;
\t float: left;
\t margin: 0px 0px 0 0;
\t text-decoration: none;
\t font-size: 14px;
\t font-family: 'Coda', cursive;
\t padding: 15px 2% 0 2%;
\t text-align: center;
\t color: #3C6B00;
\t text-transform:uppercase;
\t border-left: 2px ridge #8FDF00;
\t background: url(../images/nav_li.png) 0 -100px repeat-x;
\t -webkit-transition: all 0.3s ease;
\t -moz-transition: all 0.3s ease;
\t -o-transition: all 0.3s ease;
\t transition: all 0.3s ease;
}
<div class="subMenu">
<div class="wrap">
<div class="inner">
<div class="toolbar">
<ul>
<li> <a href="#sTop" id="sTop" class="subNavBtn">Home</a> </li>
<li> <a href="#s1" id="s1" class="subNavBtn">About</a> </li>
<li> <a href="#s2" id="s2" class="subNavBtn">Facilities</a> </li>
<li> <a href="#ss" id="ss" class="subNavBtn">Gallery</a> </li>
<li> <a href="#s3" id="s3" class="subNavBtn">Events</a> </li>
<li> <a href="#s4" id="s4" class="subNavBtn">Services</a> </li>
<li> <a href="s5" id="s5" class="subNavBtn">Contact</a> </li>
<div class="clear"></div>
</ul>
</div>
</div>
</div>
</div> \t
你能澄清一下「回到當前部分」嗎? –
這是一個單頁模板,因此每當刷新時,標題都會沿着當前的div /節。 – spykeburn