嘗試了一切,以使導航欄修復到bootstrap的頂部,但沒有任何效果。我已經試過position : relative
和position : absolute
。任何幫助感謝!Bootstrap:修復導航欄頂部
HTML:
<section style="background-color: #E8E8EA">
<nav class="navbar navbar-fixed-top" style="margin-top: 2vw; margin-right: 3vw; position: fixed;">
<div class="container-fluid">
<ul class="nav navbar-nav navbar-right">
<li><a href="#" style="border-style: solid; border-width: 1px;"><span class="glyphicon glyphicon-search rt"></span> Search</a></li>
<li><a class="qt" href="#"><span class="strike"><span class="glyphicon glyphicon-minus"></span> About Us</span></a></li>
<li><a href="#"><span class="strike"><span class="glyphicon glyphicon-minus"></span> Education</span></a></li>
<li><a href="#"><span class="strike"><span class="glyphicon glyphicon-minus"></span> Consumer Service</span></a></li>
<li><a href="#"><span class="glyphicon glyphicon-menu-hamburger" style="border-radius: 50%; border-width: 1px; border-style: solid; padding: 5px; margin-top: -5px;"></span></a></li>
</ul>
</div>
</nav>
</section>
CSS:
.nav.navbar-nav.navbar-right li a {
color: black;
background-color: transparent;
}
編輯:實現這一個頁面滾動的頁面:https://github.com/peachananr/onepage-scroll
刪除'風格=「的margin-top: 2vw; margin-right:3vw;位置:固定;「'不起作用?」 –
沒有。它沒有 –
檢查https://getbootstrap.com/docs/3.3/examples/navbar-fixed-top/。這個證明相同。 –