Ace Admin前端框架笔记二导航栏Navba
1.布局
HTML頁面中導(dǎo)航欄的默認(rèn)布局是:
1 toggle buttons: come before brand text container(.navbar-header) or inside it.
切換按鈕:出現(xiàn)在品牌文本容器(導(dǎo)航頭)之前或內(nèi)部
2 .navbar-header: brand text container.
導(dǎo)航頭:品牌文本容器
3 .navbar-menu: optional element which contains a menu or form.
導(dǎo)航菜單:包含菜單或表單的可選元素。
4 .navbar-buttons.navbar-header: contains user info buttons and dropdowns.
導(dǎo)航按鈕.導(dǎo)航頭:包含用戶信息按鈕和下拉菜單
<div id="navbar" class="navbar navbar-default"> <!-- navbar-container --><div id="navbar-container" class="navbar-container"><!-- toggle buttons are here or inside brand container --><!-- navbar-header --><div class="navbar-header pull-left"><!-- brand text here --></div><!-- navbar-menu --><nav class="navbar-menu pull-left"><!-- optional menu & form inside navbar --></nav><!-- navbar-buttons --><div class="navbar-buttons navbar-header pull-right "><ul class="nav ace-nav"><!-- user buttons such as messages, notifications and user menu --></ul></div></div> </div><!-- /.navbar -->放大一點可以看清導(dǎo)航布局,數(shù)字對應(yīng)上面 的介紹
2.響應(yīng)式導(dǎo)航欄
有兩種類型的響應(yīng)式導(dǎo)航欄:
1、Default style in which buttons move down when screen is small and below 480px.? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ?當(dāng)屏幕較小且低于480像素時,按鈕向下移動的默認(rèn)樣式。?
? ? You can change this value by modifying @screen-topbar-down variable at assets/css/less/variables.less and re-compile ace.less.
2、Bootstrap折疊樣式,它隱藏用戶按鈕和下拉菜單,當(dāng)屏幕低于992px時,切換按鈕用于隱藏/顯示它們。?
Bootstrap collapse style in which user buttons & dropdowns are hidden?
and when screen is below 992px, toggle buttons are used to hide/show them.?
Add necessary toggle buttons
Add .navbar-collapse class to .navbar element
Add .navbar-collapse and .collapse class to .navbar-buttons element
If there are is a navbar menu or form, you should add .navbar-collapse and .collapse class to .navbar-menu element
需要開啟次移動樣式,代碼如下
<!--2 Add .navbar-collapse class to .navbar element --> <div id="navbar" class="navbar navbar-default navbar-collapse"><div id="navbar-container" class="navbar-container"><div class="navbar-header pull-left"><!-- brand text here --></div><!-- /.navbar-header --><!-- 3 Add .navbar-collapse and .collapse class to .navbar-buttons element --><div class="navbar-buttons navbar-header pull-rightnavbar-collapse collapse"><ul class="nav ace-nav"><!--1 user buttons such as messages, notifications and user menu --></ul></div><!-- /.navbar-buttons --><!-- 4 If there are is a navbar menu or form, you should add .navbar-collapse and .collapse class to .navbar-menu element --><nav class="navbar-menu pull-leftnavbar-collapse collapse"><!-- optional menu & form inside navbar --></nav><!-- /.navbar-menu --></div><!-- /.navbar-container --> </div><!-- /.navbar -->3.品牌brand
Brand text is inside .navbar-header container and has the following markup:
品牌文字位于.navbar-header容器內(nèi)部,并具有以下標(biāo)記:
<div class="navbar-header pull-left"><a href="#" class="navbar-brand"><small><i class="ace-icon fa fa-leaf"></i>Brand Text</small></a></div>用戶按鈕/下拉菜單
User buttons & dropdowns are inside .navbar-buttons element, inside a ul.ace-nav list:用戶按鈕和下拉列表位于.navbar-buttons元素內(nèi)部,ul.ace-nav列表中:
<div class="navbar-buttons navbar-header pull-right"><ul class="nav ace-nav"><li class="light-blue"> 用戶下拉按鈕<a data-toggle="dropdown" class="dropdown-toggle" href="#"><i class="ace-icon fa fa-tasks"></i><span class="badge">5</span></a><ul class="dropdown-menu dropdown-navbar dropdown-menu-right dropdown-caret dropdown-close">下拉菜單<li class="dropdown-header">title text</li><li>item#1.</li><li>item#2.</li><li class="dropdown-footer">bottom text or link</li></ul></li><li>Another button and dropdown</li></ul></div>2.按鈕和菜單顏色
用戶下拉按鈕有一些顏色和選項:?
3 dropdown-content&ScrollBars
您可以將下拉的主要內(nèi)容放入.dropdown-content元素中。?這樣你可以在內(nèi)容上使用滾動條:
Default content height is?200px. You can change this using?data-size?attribute:
<li class="dropdown-content" data-size="250"></li>4.標(biāo)簽下拉菜單
您可以在下拉菜單中使用選項卡元素。?
作為一個例子,你可以看到頂級菜單頁面:
Inside each?.tab-pane?you should use a?.dropdown-menu:
用戶菜單
User menu has the following markup and is inside?ul.ace-nav?
You can also add?.user-min?class to it, so it becomes more compact:
<li class="light-blue user-min">...</li>切換按鈕 Toggle buttons
1.導(dǎo)航欄切換按鈕
Toggle buttons are used when navbar or sidebar have collapsible mobile style.?
當(dāng)導(dǎo)航欄或邊欄具有可折疊的移動樣式時,使用切換按鈕。?
You should put the code either inside .navbar-header which contains brand text or before it:
The following is a button which toggles.navbar-buttons,.navbar-menu.?
Using data-toggle and data-target attributes, you can choose to toggle any element, for example toggle only .navbar-buttons or both .navbar-buttons,.navbar-menu
<buttonclass="pull-right navbar-toggle navbar-toggle-img collapsed" type="button"data-toggle="collapse" data-target=".navbar-buttons,.navbar-menu"><span class="sr-only">Toggle user menu切換用戶菜單</span><img src="path/to/avatar/user.jpg" alt="Jason's Photo" /></button>在按鈕內(nèi)部,您還可以使用圖標(biāo)而不是頭像:
<button class="pull-right navbar-toggle collapsed" type="button"data-toggle="collapse" data-target=".navbar-buttons"><span class="sr-only">Toggle user menu</span><i class="ace-icon fa fa-user fa-2x white"></i></button>2.邊欄切換按鈕
- 在默認(rèn)響應(yīng)式(移動)樣式和可折疊響應(yīng)式樣式中,切換按鈕用于顯示和隱藏側(cè)邊欄。
- 按鈕可以在品牌文本容器(.navbar-header)或其內(nèi)部:
<a class="invisible menu-toggler" id="menu-toggler"></a><div class="sidebar responsive-min">...</div>
For collapse style sidebar in mobile view (3rd style), you should use?data-toggle?and?data-target?attributes:
導(dǎo)航菜單和窗體
1.導(dǎo)航菜單
您可以在頂部菜單示例頁面的導(dǎo)航欄內(nèi)有一個菜單。
- Inside?.navbar-menu?container, you should have?ul.nav.navbar-nav?element:
2.導(dǎo)航表單
Navbar form is similar to navbar menu.?Inside?.navbar-menu?container, the form should have?.navbar-form?class:?
<nav role="navigation" class="navbar-menu pull-left collapse navbar-collapse"><!-- you can also have a menu here --><form class="navbar-form navbar-left form-search" role="search"><div class="form-group"><input type="text" placeholder="search" /></div><button type="button" class="btn btn-xs btn-info2"><i class="ace-icon fa fa-search icon-only bigger-110"></i></button></form></nav>總結(jié)
以上是生活随笔為你收集整理的Ace Admin前端框架笔记二导航栏Navba的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【LeetCode】053. Maxim
- 下一篇: HTML5新增的几种选择器详解