bootstrap常用組件之頭部導(dǎo)航實(shí)現(xiàn)代碼
以下是頭部導(dǎo)航的代碼,我只簡(jiǎn)要的對(duì)個(gè)別常用屬性進(jìn)行解釋
總效果如圖所示:

代碼如下:
<nav class="navbar navbar-default navbar-inverse navbar-fixed-top">
//navbar-inverse 設(shè)置背景
//navbar-fixed-top 設(shè)置頭部固定在頂部,因此需要給body設(shè)置頂部padding,一般設(shè)置為padding-top:60px
<div class="Container-fluid">
//container-fluid設(shè)置導(dǎo)航條內(nèi)容是否有一定的內(nèi)間距,如果class="container-fluid"則沒(méi)有內(nèi)間距,內(nèi)容緊貼左側(cè)
//如果設(shè)置class="container",則內(nèi)容有一定的內(nèi)間距,內(nèi)容對(duì)稱居中
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button> //這里是響應(yīng)式的寫(xiě)法,在小屏幕上回顯示三桿,無(wú)需改動(dòng)
<a class="navbar-brand" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >某管理系統(tǒng)</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >首頁(yè) <span class="sr-only">(current)</span></a></li>
<li class="dropdown">
<a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">功能 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="dropdown-header" >業(yè)務(wù)功能</li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >信息建立</a></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >信息查詢</a></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >信息管理</a></li>
<li role="separator" class="divider"></li>
<li class="dropdown-header" >系統(tǒng)功能</li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >設(shè)置</a></li>
<li role="separator" class="divider"></li>
</ul>
</li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >幫助</a></li>
</ul>
<form class="navbar-form navbar-left pull-right">
<div class="form-group">
<input type="text" class="form-control" placeholder="username...">
<input type="password" class="form-control" placeholder="password...">
</div>
<button type="submit" class="btn btn-default">Login</button>
</form>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
相關(guān)文章
兩款JS腳本判斷手機(jī)瀏覽器類(lèi)型跳轉(zhuǎn)WAP手機(jī)網(wǎng)站
本文通過(guò)兩款js腳本判斷手機(jī)瀏覽器類(lèi)型跳轉(zhuǎn)到wap手機(jī)網(wǎng)站,感興趣的小伙伴快來(lái)學(xué)習(xí)吧2015-10-10
JavaScript 函數(shù)的執(zhí)行過(guò)程
下面小編就為大家?guī)?lái)一篇JavaScript 函數(shù)的執(zhí)行過(guò)程。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-05-05
20個(gè)常見(jiàn)的JavaScript數(shù)組操作總結(jié)
JavaScript中的Array對(duì)象與其他編程語(yǔ)言中的數(shù)組一樣,是一組數(shù)據(jù)的集合。在JavaScript中,數(shù)組里面的數(shù)據(jù)可以是不同類(lèi)型的,并具有用于執(zhí)行數(shù)組常見(jiàn)操作的方法,本文整理了一些常用的,需要的可以參考一下2022-09-09
JavaScript計(jì)算器網(wǎng)頁(yè)版實(shí)現(xiàn)代碼分享
這篇文章主要為大家詳細(xì)介紹了JavaScript計(jì)算器網(wǎng)頁(yè)版實(shí)現(xiàn)代碼,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-07-07
layui table復(fù)選框禁止某幾條勾選的實(shí)例
今天小編就為大家分享一篇layui table復(fù)選框禁止某幾條勾選的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2019-09-09
JS實(shí)現(xiàn)的加減乘除四則運(yùn)算計(jì)算器示例
這篇文章主要介紹了JS實(shí)現(xiàn)的加減乘除四則運(yùn)算計(jì)算器,涉及javascript事件響應(yīng)及數(shù)學(xué)運(yùn)算相關(guān)操作技巧,需要的朋友可以參考下2017-08-08
js setTimeout()函數(shù)介紹及應(yīng)用以倒計(jì)時(shí)為例
setTimeout() 方法用于在指定的毫秒數(shù)后調(diào)用函數(shù)或計(jì)算表達(dá)式,下面有個(gè)倒計(jì)時(shí)的示例,需要的朋友可以學(xué)習(xí)下2013-12-12

