bootstrap常用組件之頭部導航實現代碼,bootstrap導航

來源:互聯網
上載者:User

bootstrap常用組件之頭部導航實現代碼,bootstrap導航

以下是頭部導航的代碼,我只簡要的對個別常用屬性進行解釋

總效果:

代碼如下:

<nav class="navbar navbar-default navbar-inverse navbar-fixed-top"> //navbar-inverse 設定背景                                                        //navbar-fixed-top 設定頭部固定在頂部,因此需要給body設定頂部padding,一般設定為padding-top:60px <div class="Container-fluid"> //container-fluid設定導航條內容是否有一定的內間距,如果class="container-fluid"則沒有內間距,內容緊貼左側        //如果設定class="container",則內容有一定的內間距,內容對稱置中  <!-- 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>   //這裡是響應式的寫法,在小螢幕上回顯示三杆,無需改動   <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" >某管理系統</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" >首頁 <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" >業務功能</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" >系統功能</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>     </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>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.