全面解析Bootstrap中form、navbar的使用方法
一、表單(Form)
源碼文件:
_form.scss
mixins/_form.scss
1、按層次結構分:form-group -> form-control/input-group/form-static-control -> 各類標簽
2、Form-group/form-control/input-group/form-static-control之類的容器,分為兩種顯示方式:block、inline-block。而實現(xiàn)input-group水平用的是table-cell。
.input-group { display: inline-table; vertical-align: middle; .input-group-addon, .input-group-btn, .form-control { width: auto; } }
3、Input-group-addon:類如果插入網(wǎng)頁文字圖標,會向上一個像素的錯位
解決方案:glyphicon不能與其他樣式合并使用,而是內(nèi)部嵌套使用即可,因為glyphicon對top有1個像素的設置:
.glyphicon { position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons Halflings'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
二、導航條(navbar)
源碼文件:
_navbar.scss
1、主要進行了內(nèi)部區(qū)域的劃分,如:head、其他區(qū)域;以及導航條位置的定位
2、折疊器實現(xiàn)(在4.0已移除),也就是navbar-collapse類,代替的是collapse,在按鈕上面彈出隱藏層
2.1、Navbar-collapse:在大于breakpoint時,會強制顯示(由于collapse默認是隱藏的)
3、內(nèi)容支持nav、brand、form、toggler
4、Navbar-toggler(4.0移除):設定在屏幕小于breakpoint值時(768)顯示,而在4.0則直接用collapse來展示此按鈕,沒有屏幕大小的限制,navbar-toggle的應用也要結合collapse使用
5、Navbar-static-top:只是增加了zIndex,去掉了圓角、邊框寬度等內(nèi)容。
6、Navbar-fixed-top/bottom:都是定位在上方、下方,有浮動影響
7、Navbar-brand:品牌,可以放網(wǎng)頁名稱、公司Logo等內(nèi)容
8、Navbar-toggle:用于收縮的單擊的圖片,他會在小于breakpoint時顯示,大于此值就隱藏(并且,toggle顯示是右浮動,且作為相對定位元素):
.navbar-toggle { position: relative; float: right; margin-right: $navbar-padding-horizontal; padding: 9px 10px; @include navbar-vertical-align(34px); background-color: transparent; background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 border: 1px solid transparent; border-radius: $border-radius-base; // We remove the `outline` here, but later compensate by attaching `:hover` // styles to `:focus`. &:focus { outline: 0; } // Bars .icon-bar { display: block; width: 22px; height: 2px; border-radius: 1px; } .icon-bar + .icon-bar { margin-top: 4px; } @media (min-width: $grid-float-breakpoint) { display: none; } }
9、Navbar-nav:原nav的基礎進行了一些兼容設置,主是在breakpoint-max下的樣式調(diào)整,以及在breakpointg下的樣式調(diào)整,還是去掉默認的背景色,shadow等內(nèi)容
10、Navbar-form:主要調(diào)整所有form都為行內(nèi)元素
11、Navbar-text、navbar-btn:都在默認的基礎上做了相就的兼容設置
12、Navbar提供了default、inverse兩種主題,各主題下對其各自的部件都做了相應的樣式兼容處理
13、導航條本身的樣式不多,本身只提供了toggle、brand兩個內(nèi)容,主要提供了兩種主題,以及將dropdown、collapse、form、nav四個部件的組合。
如果大家還想深入學習,可以點擊這里進行學習,再為大家附一個精彩的專題:Bootstrap學習教程
本文系列教程整理到:Bootstrap基礎教程 專題中,歡迎點擊學習。
以上就是本文的全部內(nèi)容,希望對大家學習javascript程序設計有所幫助。
欄 目:vb
下一篇:VBA將excel數(shù)據(jù)表生成JSON文件
本文標題:全面解析Bootstrap中form、navbar的使用方法
本文地址:http://mengdiqiu.com.cn/a1/vb/7168.html
您可能感興趣的文章


閱讀排行
本欄相關
- 01-10下載文件到本地運行的vbs
- 01-10飄葉千夫指源代碼,又稱qq刷屏器
- 01-10SendKeys參考文檔
- 01-10什么是一個高效的軟件
- 01-10VBS中的正則表達式的用法大全 &l
- 01-10exe2swf 工具(Adodb.Stream版)
- 01-10VBS中SendKeys的基本應用
- 01-10用VBSCRIPT控制ONSUBMIT事件
- 01-10VBScript教程 第十一課深入VBScript
- 01-10VBScript語法速查及實例說明
隨機閱讀
- 01-11Mac OSX 打開原生自帶讀寫NTFS功能(圖文
- 01-10SublimeText編譯C開發(fā)環(huán)境設置
- 01-10使用C語言求解撲克牌的順子及n個骰子
- 01-10delphi制作wav文件的方法
- 01-10C#中split用法實例總結
- 08-05織夢dedecms什么時候用欄目交叉功能?
- 04-02jquery與jsp,用jquery
- 01-11ajax實現(xiàn)頁面的局部加載
- 08-05dedecms(織夢)副欄目數(shù)量限制代碼修改
- 08-05DEDE織夢data目錄下的sessions文件夾有什